
bin/kernel_nopage:     file format elf32-i386


Disassembly of section .text:

00100000 <kern_entry>:
.text
.globl kern_entry
kern_entry:
    # reload temperate gdt (second time) to remap all physical memory
    # virtual_addr 0~4G=linear_addr&physical_addr -KERNBASE~4G-KERNBASE 
    lgdt REALLOC(__gdtdesc)
  100000:	0f 01 15 18 70 11 40 	lgdtl  0x40117018
    movl $KERNEL_DS, %eax
  100007:	b8 10 00 00 00       	mov    $0x10,%eax
    movw %ax, %ds
  10000c:	8e d8                	mov    %eax,%ds
    movw %ax, %es
  10000e:	8e c0                	mov    %eax,%es
    movw %ax, %ss
  100010:	8e d0                	mov    %eax,%ss

    ljmp $KERNEL_CS, $relocated
  100012:	ea 19 00 10 00 08 00 	ljmp   $0x8,$0x100019

00100019 <relocated>:

relocated:

    # set ebp, esp
    movl $0x0, %ebp
  100019:	bd 00 00 00 00       	mov    $0x0,%ebp
    # the kernel stack region is from bootstack -- bootstacktop,
    # the kernel stack size is KSTACKSIZE (8KB)defined in memlayout.h
    movl $bootstacktop, %esp
  10001e:	bc 00 70 11 00       	mov    $0x117000,%esp
    # now kernel stack is ready , call the first C function
    call kern_init
  100023:	e8 02 00 00 00       	call   10002a <kern_init>

00100028 <spin>:

# should never get here
spin:
    jmp spin
  100028:	eb fe                	jmp    100028 <spin>

0010002a <kern_init>:
int kern_init(void) __attribute__((noreturn));
void grade_backtrace(void);
static void lab1_switch_test(void);

int
kern_init(void) {
  10002a:	55                   	push   %ebp
  10002b:	89 e5                	mov    %esp,%ebp
  10002d:	83 ec 28             	sub    $0x28,%esp
    extern char edata[], end[];
    memset(edata, 0, end - edata);
  100030:	ba c8 89 11 00       	mov    $0x1189c8,%edx
  100035:	b8 36 7a 11 00       	mov    $0x117a36,%eax
  10003a:	29 c2                	sub    %eax,%edx
  10003c:	89 d0                	mov    %edx,%eax
  10003e:	89 44 24 08          	mov    %eax,0x8(%esp)
  100042:	c7 44 24 04 00 00 00 	movl   $0x0,0x4(%esp)
  100049:	00 
  10004a:	c7 04 24 36 7a 11 00 	movl   $0x117a36,(%esp)
  100051:	e8 53 5e 00 00       	call   105ea9 <memset>

    cons_init();                // init the console
  100056:	e8 71 15 00 00       	call   1015cc <cons_init>

    const char *message = "(THU.CST) os is loading ...";
  10005b:	c7 45 f4 40 60 10 00 	movl   $0x106040,-0xc(%ebp)
    cprintf("%s\n\n", message);
  100062:	8b 45 f4             	mov    -0xc(%ebp),%eax
  100065:	89 44 24 04          	mov    %eax,0x4(%esp)
  100069:	c7 04 24 5c 60 10 00 	movl   $0x10605c,(%esp)
  100070:	e8 c7 02 00 00       	call   10033c <cprintf>

    print_kerninfo();
  100075:	e8 f6 07 00 00       	call   100870 <print_kerninfo>

    grade_backtrace();
  10007a:	e8 86 00 00 00       	call   100105 <grade_backtrace>

    pmm_init();                 // init physical memory management
  10007f:	e8 3c 43 00 00       	call   1043c0 <pmm_init>

    pic_init();                 // init interrupt controller
  100084:	e8 ac 16 00 00       	call   101735 <pic_init>
    idt_init();                 // init interrupt descriptor table
  100089:	e8 fe 17 00 00       	call   10188c <idt_init>

    clock_init();               // init clock interrupt
  10008e:	e8 ef 0c 00 00       	call   100d82 <clock_init>
    intr_enable();              // enable irq interrupt
  100093:	e8 0b 16 00 00       	call   1016a3 <intr_enable>
    //LAB1: CAHLLENGE 1 If you try to do it, uncomment lab1_switch_test()
    // user/kernel mode switch test
    //lab1_switch_test();

    /* do nothing */
    while (1);
  100098:	eb fe                	jmp    100098 <kern_init+0x6e>

0010009a <grade_backtrace2>:
}

void __attribute__((noinline))
grade_backtrace2(int arg0, int arg1, int arg2, int arg3) {
  10009a:	55                   	push   %ebp
  10009b:	89 e5                	mov    %esp,%ebp
  10009d:	83 ec 18             	sub    $0x18,%esp
    mon_backtrace(0, NULL, NULL);
  1000a0:	c7 44 24 08 00 00 00 	movl   $0x0,0x8(%esp)
  1000a7:	00 
  1000a8:	c7 44 24 04 00 00 00 	movl   $0x0,0x4(%esp)
  1000af:	00 
  1000b0:	c7 04 24 00 00 00 00 	movl   $0x0,(%esp)
  1000b7:	e8 f8 0b 00 00       	call   100cb4 <mon_backtrace>
}
  1000bc:	c9                   	leave  
  1000bd:	c3                   	ret    

001000be <grade_backtrace1>:

void __attribute__((noinline))
grade_backtrace1(int arg0, int arg1) {
  1000be:	55                   	push   %ebp
  1000bf:	89 e5                	mov    %esp,%ebp
  1000c1:	53                   	push   %ebx
  1000c2:	83 ec 14             	sub    $0x14,%esp
    grade_backtrace2(arg0, (int)&arg0, arg1, (int)&arg1);
  1000c5:	8d 5d 0c             	lea    0xc(%ebp),%ebx
  1000c8:	8b 4d 0c             	mov    0xc(%ebp),%ecx
  1000cb:	8d 55 08             	lea    0x8(%ebp),%edx
  1000ce:	8b 45 08             	mov    0x8(%ebp),%eax
  1000d1:	89 5c 24 0c          	mov    %ebx,0xc(%esp)
  1000d5:	89 4c 24 08          	mov    %ecx,0x8(%esp)
  1000d9:	89 54 24 04          	mov    %edx,0x4(%esp)
  1000dd:	89 04 24             	mov    %eax,(%esp)
  1000e0:	e8 b5 ff ff ff       	call   10009a <grade_backtrace2>
}
  1000e5:	83 c4 14             	add    $0x14,%esp
  1000e8:	5b                   	pop    %ebx
  1000e9:	5d                   	pop    %ebp
  1000ea:	c3                   	ret    

001000eb <grade_backtrace0>:

void __attribute__((noinline))
grade_backtrace0(int arg0, int arg1, int arg2) {
  1000eb:	55                   	push   %ebp
  1000ec:	89 e5                	mov    %esp,%ebp
  1000ee:	83 ec 18             	sub    $0x18,%esp
    grade_backtrace1(arg0, arg2);
  1000f1:	8b 45 10             	mov    0x10(%ebp),%eax
  1000f4:	89 44 24 04          	mov    %eax,0x4(%esp)
  1000f8:	8b 45 08             	mov    0x8(%ebp),%eax
  1000fb:	89 04 24             	mov    %eax,(%esp)
  1000fe:	e8 bb ff ff ff       	call   1000be <grade_backtrace1>
}
  100103:	c9                   	leave  
  100104:	c3                   	ret    

00100105 <grade_backtrace>:

void
grade_backtrace(void) {
  100105:	55                   	push   %ebp
  100106:	89 e5                	mov    %esp,%ebp
  100108:	83 ec 18             	sub    $0x18,%esp
    grade_backtrace0(0, (int)kern_init, 0xffff0000);
  10010b:	b8 2a 00 10 00       	mov    $0x10002a,%eax
  100110:	c7 44 24 08 00 00 ff 	movl   $0xffff0000,0x8(%esp)
  100117:	ff 
  100118:	89 44 24 04          	mov    %eax,0x4(%esp)
  10011c:	c7 04 24 00 00 00 00 	movl   $0x0,(%esp)
  100123:	e8 c3 ff ff ff       	call   1000eb <grade_backtrace0>
}
  100128:	c9                   	leave  
  100129:	c3                   	ret    

0010012a <lab1_print_cur_status>:

static void
lab1_print_cur_status(void) {
  10012a:	55                   	push   %ebp
  10012b:	89 e5                	mov    %esp,%ebp
  10012d:	83 ec 28             	sub    $0x28,%esp
    static int round = 0;
    uint16_t reg1, reg2, reg3, reg4;
    asm volatile (
  100130:	8c 4d f6             	mov    %cs,-0xa(%ebp)
  100133:	8c 5d f4             	mov    %ds,-0xc(%ebp)
  100136:	8c 45 f2             	mov    %es,-0xe(%ebp)
  100139:	8c 55 f0             	mov    %ss,-0x10(%ebp)
            "mov %%cs, %0;"
            "mov %%ds, %1;"
            "mov %%es, %2;"
            "mov %%ss, %3;"
            : "=m"(reg1), "=m"(reg2), "=m"(reg3), "=m"(reg4));
    cprintf("%d: @ring %d\n", round, reg1 & 3);
  10013c:	0f b7 45 f6          	movzwl -0xa(%ebp),%eax
  100140:	0f b7 c0             	movzwl %ax,%eax
  100143:	83 e0 03             	and    $0x3,%eax
  100146:	89 c2                	mov    %eax,%edx
  100148:	a1 40 7a 11 00       	mov    0x117a40,%eax
  10014d:	89 54 24 08          	mov    %edx,0x8(%esp)
  100151:	89 44 24 04          	mov    %eax,0x4(%esp)
  100155:	c7 04 24 61 60 10 00 	movl   $0x106061,(%esp)
  10015c:	e8 db 01 00 00       	call   10033c <cprintf>
    cprintf("%d:  cs = %x\n", round, reg1);
  100161:	0f b7 45 f6          	movzwl -0xa(%ebp),%eax
  100165:	0f b7 d0             	movzwl %ax,%edx
  100168:	a1 40 7a 11 00       	mov    0x117a40,%eax
  10016d:	89 54 24 08          	mov    %edx,0x8(%esp)
  100171:	89 44 24 04          	mov    %eax,0x4(%esp)
  100175:	c7 04 24 6f 60 10 00 	movl   $0x10606f,(%esp)
  10017c:	e8 bb 01 00 00       	call   10033c <cprintf>
    cprintf("%d:  ds = %x\n", round, reg2);
  100181:	0f b7 45 f4          	movzwl -0xc(%ebp),%eax
  100185:	0f b7 d0             	movzwl %ax,%edx
  100188:	a1 40 7a 11 00       	mov    0x117a40,%eax
  10018d:	89 54 24 08          	mov    %edx,0x8(%esp)
  100191:	89 44 24 04          	mov    %eax,0x4(%esp)
  100195:	c7 04 24 7d 60 10 00 	movl   $0x10607d,(%esp)
  10019c:	e8 9b 01 00 00       	call   10033c <cprintf>
    cprintf("%d:  es = %x\n", round, reg3);
  1001a1:	0f b7 45 f2          	movzwl -0xe(%ebp),%eax
  1001a5:	0f b7 d0             	movzwl %ax,%edx
  1001a8:	a1 40 7a 11 00       	mov    0x117a40,%eax
  1001ad:	89 54 24 08          	mov    %edx,0x8(%esp)
  1001b1:	89 44 24 04          	mov    %eax,0x4(%esp)
  1001b5:	c7 04 24 8b 60 10 00 	movl   $0x10608b,(%esp)
  1001bc:	e8 7b 01 00 00       	call   10033c <cprintf>
    cprintf("%d:  ss = %x\n", round, reg4);
  1001c1:	0f b7 45 f0          	movzwl -0x10(%ebp),%eax
  1001c5:	0f b7 d0             	movzwl %ax,%edx
  1001c8:	a1 40 7a 11 00       	mov    0x117a40,%eax
  1001cd:	89 54 24 08          	mov    %edx,0x8(%esp)
  1001d1:	89 44 24 04          	mov    %eax,0x4(%esp)
  1001d5:	c7 04 24 99 60 10 00 	movl   $0x106099,(%esp)
  1001dc:	e8 5b 01 00 00       	call   10033c <cprintf>
    round ++;
  1001e1:	a1 40 7a 11 00       	mov    0x117a40,%eax
  1001e6:	83 c0 01             	add    $0x1,%eax
  1001e9:	a3 40 7a 11 00       	mov    %eax,0x117a40
}
  1001ee:	c9                   	leave  
  1001ef:	c3                   	ret    

001001f0 <lab1_switch_to_user>:

static void
lab1_switch_to_user(void) {
  1001f0:	55                   	push   %ebp
  1001f1:	89 e5                	mov    %esp,%ebp
    //LAB1 CHALLENGE 1 : TODO
}
  1001f3:	5d                   	pop    %ebp
  1001f4:	c3                   	ret    

001001f5 <lab1_switch_to_kernel>:

static void
lab1_switch_to_kernel(void) {
  1001f5:	55                   	push   %ebp
  1001f6:	89 e5                	mov    %esp,%ebp
    //LAB1 CHALLENGE 1 :  TODO
}
  1001f8:	5d                   	pop    %ebp
  1001f9:	c3                   	ret    

001001fa <lab1_switch_test>:

static void
lab1_switch_test(void) {
  1001fa:	55                   	push   %ebp
  1001fb:	89 e5                	mov    %esp,%ebp
  1001fd:	83 ec 18             	sub    $0x18,%esp
    lab1_print_cur_status();
  100200:	e8 25 ff ff ff       	call   10012a <lab1_print_cur_status>
    cprintf("+++ switch to  user  mode +++\n");
  100205:	c7 04 24 a8 60 10 00 	movl   $0x1060a8,(%esp)
  10020c:	e8 2b 01 00 00       	call   10033c <cprintf>
    lab1_switch_to_user();
  100211:	e8 da ff ff ff       	call   1001f0 <lab1_switch_to_user>
    lab1_print_cur_status();
  100216:	e8 0f ff ff ff       	call   10012a <lab1_print_cur_status>
    cprintf("+++ switch to kernel mode +++\n");
  10021b:	c7 04 24 c8 60 10 00 	movl   $0x1060c8,(%esp)
  100222:	e8 15 01 00 00       	call   10033c <cprintf>
    lab1_switch_to_kernel();
  100227:	e8 c9 ff ff ff       	call   1001f5 <lab1_switch_to_kernel>
    lab1_print_cur_status();
  10022c:	e8 f9 fe ff ff       	call   10012a <lab1_print_cur_status>
}
  100231:	c9                   	leave  
  100232:	c3                   	ret    

00100233 <readline>:
 * The readline() function returns the text of the line read. If some errors
 * are happened, NULL is returned. The return value is a global variable,
 * thus it should be copied before it is used.
 * */
char *
readline(const char *prompt) {
  100233:	55                   	push   %ebp
  100234:	89 e5                	mov    %esp,%ebp
  100236:	83 ec 28             	sub    $0x28,%esp
    if (prompt != NULL) {
  100239:	83 7d 08 00          	cmpl   $0x0,0x8(%ebp)
  10023d:	74 13                	je     100252 <readline+0x1f>
        cprintf("%s", prompt);
  10023f:	8b 45 08             	mov    0x8(%ebp),%eax
  100242:	89 44 24 04          	mov    %eax,0x4(%esp)
  100246:	c7 04 24 e7 60 10 00 	movl   $0x1060e7,(%esp)
  10024d:	e8 ea 00 00 00       	call   10033c <cprintf>
    }
    int i = 0, c;
  100252:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)
    while (1) {
        c = getchar();
  100259:	e8 66 01 00 00       	call   1003c4 <getchar>
  10025e:	89 45 f0             	mov    %eax,-0x10(%ebp)
        if (c < 0) {
  100261:	83 7d f0 00          	cmpl   $0x0,-0x10(%ebp)
  100265:	79 07                	jns    10026e <readline+0x3b>
            return NULL;
  100267:	b8 00 00 00 00       	mov    $0x0,%eax
  10026c:	eb 79                	jmp    1002e7 <readline+0xb4>
        }
        else if (c >= ' ' && i < BUFSIZE - 1) {
  10026e:	83 7d f0 1f          	cmpl   $0x1f,-0x10(%ebp)
  100272:	7e 28                	jle    10029c <readline+0x69>
  100274:	81 7d f4 fe 03 00 00 	cmpl   $0x3fe,-0xc(%ebp)
  10027b:	7f 1f                	jg     10029c <readline+0x69>
            cputchar(c);
  10027d:	8b 45 f0             	mov    -0x10(%ebp),%eax
  100280:	89 04 24             	mov    %eax,(%esp)
  100283:	e8 da 00 00 00       	call   100362 <cputchar>
            buf[i ++] = c;
  100288:	8b 45 f4             	mov    -0xc(%ebp),%eax
  10028b:	8d 50 01             	lea    0x1(%eax),%edx
  10028e:	89 55 f4             	mov    %edx,-0xc(%ebp)
  100291:	8b 55 f0             	mov    -0x10(%ebp),%edx
  100294:	88 90 60 7a 11 00    	mov    %dl,0x117a60(%eax)
  10029a:	eb 46                	jmp    1002e2 <readline+0xaf>
        }
        else if (c == '\b' && i > 0) {
  10029c:	83 7d f0 08          	cmpl   $0x8,-0x10(%ebp)
  1002a0:	75 17                	jne    1002b9 <readline+0x86>
  1002a2:	83 7d f4 00          	cmpl   $0x0,-0xc(%ebp)
  1002a6:	7e 11                	jle    1002b9 <readline+0x86>
            cputchar(c);
  1002a8:	8b 45 f0             	mov    -0x10(%ebp),%eax
  1002ab:	89 04 24             	mov    %eax,(%esp)
  1002ae:	e8 af 00 00 00       	call   100362 <cputchar>
            i --;
  1002b3:	83 6d f4 01          	subl   $0x1,-0xc(%ebp)
  1002b7:	eb 29                	jmp    1002e2 <readline+0xaf>
        }
        else if (c == '\n' || c == '\r') {
  1002b9:	83 7d f0 0a          	cmpl   $0xa,-0x10(%ebp)
  1002bd:	74 06                	je     1002c5 <readline+0x92>
  1002bf:	83 7d f0 0d          	cmpl   $0xd,-0x10(%ebp)
  1002c3:	75 1d                	jne    1002e2 <readline+0xaf>
            cputchar(c);
  1002c5:	8b 45 f0             	mov    -0x10(%ebp),%eax
  1002c8:	89 04 24             	mov    %eax,(%esp)
  1002cb:	e8 92 00 00 00       	call   100362 <cputchar>
            buf[i] = '\0';
  1002d0:	8b 45 f4             	mov    -0xc(%ebp),%eax
  1002d3:	05 60 7a 11 00       	add    $0x117a60,%eax
  1002d8:	c6 00 00             	movb   $0x0,(%eax)
            return buf;
  1002db:	b8 60 7a 11 00       	mov    $0x117a60,%eax
  1002e0:	eb 05                	jmp    1002e7 <readline+0xb4>
        }
    }
  1002e2:	e9 72 ff ff ff       	jmp    100259 <readline+0x26>
}
  1002e7:	c9                   	leave  
  1002e8:	c3                   	ret    

001002e9 <cputch>:
/* *
 * cputch - writes a single character @c to stdout, and it will
 * increace the value of counter pointed by @cnt.
 * */
static void
cputch(int c, int *cnt) {
  1002e9:	55                   	push   %ebp
  1002ea:	89 e5                	mov    %esp,%ebp
  1002ec:	83 ec 18             	sub    $0x18,%esp
    cons_putc(c);
  1002ef:	8b 45 08             	mov    0x8(%ebp),%eax
  1002f2:	89 04 24             	mov    %eax,(%esp)
  1002f5:	e8 fe 12 00 00       	call   1015f8 <cons_putc>
    (*cnt) ++;
  1002fa:	8b 45 0c             	mov    0xc(%ebp),%eax
  1002fd:	8b 00                	mov    (%eax),%eax
  1002ff:	8d 50 01             	lea    0x1(%eax),%edx
  100302:	8b 45 0c             	mov    0xc(%ebp),%eax
  100305:	89 10                	mov    %edx,(%eax)
}
  100307:	c9                   	leave  
  100308:	c3                   	ret    

00100309 <vcprintf>:
 *
 * Call this function if you are already dealing with a va_list.
 * Or you probably want cprintf() instead.
 * */
int
vcprintf(const char *fmt, va_list ap) {
  100309:	55                   	push   %ebp
  10030a:	89 e5                	mov    %esp,%ebp
  10030c:	83 ec 28             	sub    $0x28,%esp
    int cnt = 0;
  10030f:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)
    vprintfmt((void*)cputch, &cnt, fmt, ap);
  100316:	8b 45 0c             	mov    0xc(%ebp),%eax
  100319:	89 44 24 0c          	mov    %eax,0xc(%esp)
  10031d:	8b 45 08             	mov    0x8(%ebp),%eax
  100320:	89 44 24 08          	mov    %eax,0x8(%esp)
  100324:	8d 45 f4             	lea    -0xc(%ebp),%eax
  100327:	89 44 24 04          	mov    %eax,0x4(%esp)
  10032b:	c7 04 24 e9 02 10 00 	movl   $0x1002e9,(%esp)
  100332:	e8 8b 53 00 00       	call   1056c2 <vprintfmt>
    return cnt;
  100337:	8b 45 f4             	mov    -0xc(%ebp),%eax
}
  10033a:	c9                   	leave  
  10033b:	c3                   	ret    

0010033c <cprintf>:
 *
 * The return value is the number of characters which would be
 * written to stdout.
 * */
int
cprintf(const char *fmt, ...) {
  10033c:	55                   	push   %ebp
  10033d:	89 e5                	mov    %esp,%ebp
  10033f:	83 ec 28             	sub    $0x28,%esp
    va_list ap;
    int cnt;
    va_start(ap, fmt);
  100342:	8d 45 0c             	lea    0xc(%ebp),%eax
  100345:	89 45 f0             	mov    %eax,-0x10(%ebp)
    cnt = vcprintf(fmt, ap);
  100348:	8b 45 f0             	mov    -0x10(%ebp),%eax
  10034b:	89 44 24 04          	mov    %eax,0x4(%esp)
  10034f:	8b 45 08             	mov    0x8(%ebp),%eax
  100352:	89 04 24             	mov    %eax,(%esp)
  100355:	e8 af ff ff ff       	call   100309 <vcprintf>
  10035a:	89 45 f4             	mov    %eax,-0xc(%ebp)
    va_end(ap);
    return cnt;
  10035d:	8b 45 f4             	mov    -0xc(%ebp),%eax
}
  100360:	c9                   	leave  
  100361:	c3                   	ret    

00100362 <cputchar>:

/* cputchar - writes a single character to stdout */
void
cputchar(int c) {
  100362:	55                   	push   %ebp
  100363:	89 e5                	mov    %esp,%ebp
  100365:	83 ec 18             	sub    $0x18,%esp
    cons_putc(c);
  100368:	8b 45 08             	mov    0x8(%ebp),%eax
  10036b:	89 04 24             	mov    %eax,(%esp)
  10036e:	e8 85 12 00 00       	call   1015f8 <cons_putc>
}
  100373:	c9                   	leave  
  100374:	c3                   	ret    

00100375 <cputs>:
/* *
 * cputs- writes the string pointed by @str to stdout and
 * appends a newline character.
 * */
int
cputs(const char *str) {
  100375:	55                   	push   %ebp
  100376:	89 e5                	mov    %esp,%ebp
  100378:	83 ec 28             	sub    $0x28,%esp
    int cnt = 0;
  10037b:	c7 45 f0 00 00 00 00 	movl   $0x0,-0x10(%ebp)
    char c;
    while ((c = *str ++) != '\0') {
  100382:	eb 13                	jmp    100397 <cputs+0x22>
        cputch(c, &cnt);
  100384:	0f be 45 f7          	movsbl -0x9(%ebp),%eax
  100388:	8d 55 f0             	lea    -0x10(%ebp),%edx
  10038b:	89 54 24 04          	mov    %edx,0x4(%esp)
  10038f:	89 04 24             	mov    %eax,(%esp)
  100392:	e8 52 ff ff ff       	call   1002e9 <cputch>
 * */
int
cputs(const char *str) {
    int cnt = 0;
    char c;
    while ((c = *str ++) != '\0') {
  100397:	8b 45 08             	mov    0x8(%ebp),%eax
  10039a:	8d 50 01             	lea    0x1(%eax),%edx
  10039d:	89 55 08             	mov    %edx,0x8(%ebp)
  1003a0:	0f b6 00             	movzbl (%eax),%eax
  1003a3:	88 45 f7             	mov    %al,-0x9(%ebp)
  1003a6:	80 7d f7 00          	cmpb   $0x0,-0x9(%ebp)
  1003aa:	75 d8                	jne    100384 <cputs+0xf>
        cputch(c, &cnt);
    }
    cputch('\n', &cnt);
  1003ac:	8d 45 f0             	lea    -0x10(%ebp),%eax
  1003af:	89 44 24 04          	mov    %eax,0x4(%esp)
  1003b3:	c7 04 24 0a 00 00 00 	movl   $0xa,(%esp)
  1003ba:	e8 2a ff ff ff       	call   1002e9 <cputch>
    return cnt;
  1003bf:	8b 45 f0             	mov    -0x10(%ebp),%eax
}
  1003c2:	c9                   	leave  
  1003c3:	c3                   	ret    

001003c4 <getchar>:

/* getchar - reads a single non-zero character from stdin */
int
getchar(void) {
  1003c4:	55                   	push   %ebp
  1003c5:	89 e5                	mov    %esp,%ebp
  1003c7:	83 ec 18             	sub    $0x18,%esp
    int c;
    while ((c = cons_getc()) == 0)
  1003ca:	e8 65 12 00 00       	call   101634 <cons_getc>
  1003cf:	89 45 f4             	mov    %eax,-0xc(%ebp)
  1003d2:	83 7d f4 00          	cmpl   $0x0,-0xc(%ebp)
  1003d6:	74 f2                	je     1003ca <getchar+0x6>
        /* do nothing */;
    return c;
  1003d8:	8b 45 f4             	mov    -0xc(%ebp),%eax
}
  1003db:	c9                   	leave  
  1003dc:	c3                   	ret    

001003dd <stab_binsearch>:
 *      stab_binsearch(stabs, &left, &right, N_SO, 0xf0100184);
 * will exit setting left = 118, right = 554.
 * */
static void
stab_binsearch(const struct stab *stabs, int *region_left, int *region_right,
           int type, uintptr_t addr) {
  1003dd:	55                   	push   %ebp
  1003de:	89 e5                	mov    %esp,%ebp
  1003e0:	83 ec 20             	sub    $0x20,%esp
    int l = *region_left, r = *region_right, any_matches = 0;
  1003e3:	8b 45 0c             	mov    0xc(%ebp),%eax
  1003e6:	8b 00                	mov    (%eax),%eax
  1003e8:	89 45 fc             	mov    %eax,-0x4(%ebp)
  1003eb:	8b 45 10             	mov    0x10(%ebp),%eax
  1003ee:	8b 00                	mov    (%eax),%eax
  1003f0:	89 45 f8             	mov    %eax,-0x8(%ebp)
  1003f3:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)

    while (l <= r) {
  1003fa:	e9 d2 00 00 00       	jmp    1004d1 <stab_binsearch+0xf4>
        int true_m = (l + r) / 2, m = true_m;
  1003ff:	8b 45 f8             	mov    -0x8(%ebp),%eax
  100402:	8b 55 fc             	mov    -0x4(%ebp),%edx
  100405:	01 d0                	add    %edx,%eax
  100407:	89 c2                	mov    %eax,%edx
  100409:	c1 ea 1f             	shr    $0x1f,%edx
  10040c:	01 d0                	add    %edx,%eax
  10040e:	d1 f8                	sar    %eax
  100410:	89 45 ec             	mov    %eax,-0x14(%ebp)
  100413:	8b 45 ec             	mov    -0x14(%ebp),%eax
  100416:	89 45 f0             	mov    %eax,-0x10(%ebp)

        // search for earliest stab with right type
        while (m >= l && stabs[m].n_type != type) {
  100419:	eb 04                	jmp    10041f <stab_binsearch+0x42>
            m --;
  10041b:	83 6d f0 01          	subl   $0x1,-0x10(%ebp)

    while (l <= r) {
        int true_m = (l + r) / 2, m = true_m;

        // search for earliest stab with right type
        while (m >= l && stabs[m].n_type != type) {
  10041f:	8b 45 f0             	mov    -0x10(%ebp),%eax
  100422:	3b 45 fc             	cmp    -0x4(%ebp),%eax
  100425:	7c 1f                	jl     100446 <stab_binsearch+0x69>
  100427:	8b 55 f0             	mov    -0x10(%ebp),%edx
  10042a:	89 d0                	mov    %edx,%eax
  10042c:	01 c0                	add    %eax,%eax
  10042e:	01 d0                	add    %edx,%eax
  100430:	c1 e0 02             	shl    $0x2,%eax
  100433:	89 c2                	mov    %eax,%edx
  100435:	8b 45 08             	mov    0x8(%ebp),%eax
  100438:	01 d0                	add    %edx,%eax
  10043a:	0f b6 40 04          	movzbl 0x4(%eax),%eax
  10043e:	0f b6 c0             	movzbl %al,%eax
  100441:	3b 45 14             	cmp    0x14(%ebp),%eax
  100444:	75 d5                	jne    10041b <stab_binsearch+0x3e>
            m --;
        }
        if (m < l) {    // no match in [l, m]
  100446:	8b 45 f0             	mov    -0x10(%ebp),%eax
  100449:	3b 45 fc             	cmp    -0x4(%ebp),%eax
  10044c:	7d 0b                	jge    100459 <stab_binsearch+0x7c>
            l = true_m + 1;
  10044e:	8b 45 ec             	mov    -0x14(%ebp),%eax
  100451:	83 c0 01             	add    $0x1,%eax
  100454:	89 45 fc             	mov    %eax,-0x4(%ebp)
            continue;
  100457:	eb 78                	jmp    1004d1 <stab_binsearch+0xf4>
        }

        // actual binary search
        any_matches = 1;
  100459:	c7 45 f4 01 00 00 00 	movl   $0x1,-0xc(%ebp)
        if (stabs[m].n_value < addr) {
  100460:	8b 55 f0             	mov    -0x10(%ebp),%edx
  100463:	89 d0                	mov    %edx,%eax
  100465:	01 c0                	add    %eax,%eax
  100467:	01 d0                	add    %edx,%eax
  100469:	c1 e0 02             	shl    $0x2,%eax
  10046c:	89 c2                	mov    %eax,%edx
  10046e:	8b 45 08             	mov    0x8(%ebp),%eax
  100471:	01 d0                	add    %edx,%eax
  100473:	8b 40 08             	mov    0x8(%eax),%eax
  100476:	3b 45 18             	cmp    0x18(%ebp),%eax
  100479:	73 13                	jae    10048e <stab_binsearch+0xb1>
            *region_left = m;
  10047b:	8b 45 0c             	mov    0xc(%ebp),%eax
  10047e:	8b 55 f0             	mov    -0x10(%ebp),%edx
  100481:	89 10                	mov    %edx,(%eax)
            l = true_m + 1;
  100483:	8b 45 ec             	mov    -0x14(%ebp),%eax
  100486:	83 c0 01             	add    $0x1,%eax
  100489:	89 45 fc             	mov    %eax,-0x4(%ebp)
  10048c:	eb 43                	jmp    1004d1 <stab_binsearch+0xf4>
        } else if (stabs[m].n_value > addr) {
  10048e:	8b 55 f0             	mov    -0x10(%ebp),%edx
  100491:	89 d0                	mov    %edx,%eax
  100493:	01 c0                	add    %eax,%eax
  100495:	01 d0                	add    %edx,%eax
  100497:	c1 e0 02             	shl    $0x2,%eax
  10049a:	89 c2                	mov    %eax,%edx
  10049c:	8b 45 08             	mov    0x8(%ebp),%eax
  10049f:	01 d0                	add    %edx,%eax
  1004a1:	8b 40 08             	mov    0x8(%eax),%eax
  1004a4:	3b 45 18             	cmp    0x18(%ebp),%eax
  1004a7:	76 16                	jbe    1004bf <stab_binsearch+0xe2>
            *region_right = m - 1;
  1004a9:	8b 45 f0             	mov    -0x10(%ebp),%eax
  1004ac:	8d 50 ff             	lea    -0x1(%eax),%edx
  1004af:	8b 45 10             	mov    0x10(%ebp),%eax
  1004b2:	89 10                	mov    %edx,(%eax)
            r = m - 1;
  1004b4:	8b 45 f0             	mov    -0x10(%ebp),%eax
  1004b7:	83 e8 01             	sub    $0x1,%eax
  1004ba:	89 45 f8             	mov    %eax,-0x8(%ebp)
  1004bd:	eb 12                	jmp    1004d1 <stab_binsearch+0xf4>
        } else {
            // exact match for 'addr', but continue loop to find
            // *region_right
            *region_left = m;
  1004bf:	8b 45 0c             	mov    0xc(%ebp),%eax
  1004c2:	8b 55 f0             	mov    -0x10(%ebp),%edx
  1004c5:	89 10                	mov    %edx,(%eax)
            l = m;
  1004c7:	8b 45 f0             	mov    -0x10(%ebp),%eax
  1004ca:	89 45 fc             	mov    %eax,-0x4(%ebp)
            addr ++;
  1004cd:	83 45 18 01          	addl   $0x1,0x18(%ebp)
static void
stab_binsearch(const struct stab *stabs, int *region_left, int *region_right,
           int type, uintptr_t addr) {
    int l = *region_left, r = *region_right, any_matches = 0;

    while (l <= r) {
  1004d1:	8b 45 fc             	mov    -0x4(%ebp),%eax
  1004d4:	3b 45 f8             	cmp    -0x8(%ebp),%eax
  1004d7:	0f 8e 22 ff ff ff    	jle    1003ff <stab_binsearch+0x22>
            l = m;
            addr ++;
        }
    }

    if (!any_matches) {
  1004dd:	83 7d f4 00          	cmpl   $0x0,-0xc(%ebp)
  1004e1:	75 0f                	jne    1004f2 <stab_binsearch+0x115>
        *region_right = *region_left - 1;
  1004e3:	8b 45 0c             	mov    0xc(%ebp),%eax
  1004e6:	8b 00                	mov    (%eax),%eax
  1004e8:	8d 50 ff             	lea    -0x1(%eax),%edx
  1004eb:	8b 45 10             	mov    0x10(%ebp),%eax
  1004ee:	89 10                	mov    %edx,(%eax)
  1004f0:	eb 3f                	jmp    100531 <stab_binsearch+0x154>
    }
    else {
        // find rightmost region containing 'addr'
        l = *region_right;
  1004f2:	8b 45 10             	mov    0x10(%ebp),%eax
  1004f5:	8b 00                	mov    (%eax),%eax
  1004f7:	89 45 fc             	mov    %eax,-0x4(%ebp)
        for (; l > *region_left && stabs[l].n_type != type; l --)
  1004fa:	eb 04                	jmp    100500 <stab_binsearch+0x123>
  1004fc:	83 6d fc 01          	subl   $0x1,-0x4(%ebp)
  100500:	8b 45 0c             	mov    0xc(%ebp),%eax
  100503:	8b 00                	mov    (%eax),%eax
  100505:	3b 45 fc             	cmp    -0x4(%ebp),%eax
  100508:	7d 1f                	jge    100529 <stab_binsearch+0x14c>
  10050a:	8b 55 fc             	mov    -0x4(%ebp),%edx
  10050d:	89 d0                	mov    %edx,%eax
  10050f:	01 c0                	add    %eax,%eax
  100511:	01 d0                	add    %edx,%eax
  100513:	c1 e0 02             	shl    $0x2,%eax
  100516:	89 c2                	mov    %eax,%edx
  100518:	8b 45 08             	mov    0x8(%ebp),%eax
  10051b:	01 d0                	add    %edx,%eax
  10051d:	0f b6 40 04          	movzbl 0x4(%eax),%eax
  100521:	0f b6 c0             	movzbl %al,%eax
  100524:	3b 45 14             	cmp    0x14(%ebp),%eax
  100527:	75 d3                	jne    1004fc <stab_binsearch+0x11f>
            /* do nothing */;
        *region_left = l;
  100529:	8b 45 0c             	mov    0xc(%ebp),%eax
  10052c:	8b 55 fc             	mov    -0x4(%ebp),%edx
  10052f:	89 10                	mov    %edx,(%eax)
    }
}
  100531:	c9                   	leave  
  100532:	c3                   	ret    

00100533 <debuginfo_eip>:
 * the specified instruction address, @addr.  Returns 0 if information
 * was found, and negative if not.  But even if it returns negative it
 * has stored some information into '*info'.
 * */
int
debuginfo_eip(uintptr_t addr, struct eipdebuginfo *info) {
  100533:	55                   	push   %ebp
  100534:	89 e5                	mov    %esp,%ebp
  100536:	83 ec 58             	sub    $0x58,%esp
    const struct stab *stabs, *stab_end;
    const char *stabstr, *stabstr_end;

    info->eip_file = "<unknown>";
  100539:	8b 45 0c             	mov    0xc(%ebp),%eax
  10053c:	c7 00 ec 60 10 00    	movl   $0x1060ec,(%eax)
    info->eip_line = 0;
  100542:	8b 45 0c             	mov    0xc(%ebp),%eax
  100545:	c7 40 04 00 00 00 00 	movl   $0x0,0x4(%eax)
    info->eip_fn_name = "<unknown>";
  10054c:	8b 45 0c             	mov    0xc(%ebp),%eax
  10054f:	c7 40 08 ec 60 10 00 	movl   $0x1060ec,0x8(%eax)
    info->eip_fn_namelen = 9;
  100556:	8b 45 0c             	mov    0xc(%ebp),%eax
  100559:	c7 40 0c 09 00 00 00 	movl   $0x9,0xc(%eax)
    info->eip_fn_addr = addr;
  100560:	8b 45 0c             	mov    0xc(%ebp),%eax
  100563:	8b 55 08             	mov    0x8(%ebp),%edx
  100566:	89 50 10             	mov    %edx,0x10(%eax)
    info->eip_fn_narg = 0;
  100569:	8b 45 0c             	mov    0xc(%ebp),%eax
  10056c:	c7 40 14 00 00 00 00 	movl   $0x0,0x14(%eax)

    stabs = __STAB_BEGIN__;
  100573:	c7 45 f4 28 73 10 00 	movl   $0x107328,-0xc(%ebp)
    stab_end = __STAB_END__;
  10057a:	c7 45 f0 d8 1f 11 00 	movl   $0x111fd8,-0x10(%ebp)
    stabstr = __STABSTR_BEGIN__;
  100581:	c7 45 ec d9 1f 11 00 	movl   $0x111fd9,-0x14(%ebp)
    stabstr_end = __STABSTR_END__;
  100588:	c7 45 e8 37 4a 11 00 	movl   $0x114a37,-0x18(%ebp)

    // String table validity checks
    if (stabstr_end <= stabstr || stabstr_end[-1] != 0) {
  10058f:	8b 45 e8             	mov    -0x18(%ebp),%eax
  100592:	3b 45 ec             	cmp    -0x14(%ebp),%eax
  100595:	76 0d                	jbe    1005a4 <debuginfo_eip+0x71>
  100597:	8b 45 e8             	mov    -0x18(%ebp),%eax
  10059a:	83 e8 01             	sub    $0x1,%eax
  10059d:	0f b6 00             	movzbl (%eax),%eax
  1005a0:	84 c0                	test   %al,%al
  1005a2:	74 0a                	je     1005ae <debuginfo_eip+0x7b>
        return -1;
  1005a4:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
  1005a9:	e9 c0 02 00 00       	jmp    10086e <debuginfo_eip+0x33b>
    // 'eip'.  First, we find the basic source file containing 'eip'.
    // Then, we look in that source file for the function.  Then we look
    // for the line number.

    // Search the entire set of stabs for the source file (type N_SO).
    int lfile = 0, rfile = (stab_end - stabs) - 1;
  1005ae:	c7 45 e4 00 00 00 00 	movl   $0x0,-0x1c(%ebp)
  1005b5:	8b 55 f0             	mov    -0x10(%ebp),%edx
  1005b8:	8b 45 f4             	mov    -0xc(%ebp),%eax
  1005bb:	29 c2                	sub    %eax,%edx
  1005bd:	89 d0                	mov    %edx,%eax
  1005bf:	c1 f8 02             	sar    $0x2,%eax
  1005c2:	69 c0 ab aa aa aa    	imul   $0xaaaaaaab,%eax,%eax
  1005c8:	83 e8 01             	sub    $0x1,%eax
  1005cb:	89 45 e0             	mov    %eax,-0x20(%ebp)
    stab_binsearch(stabs, &lfile, &rfile, N_SO, addr);
  1005ce:	8b 45 08             	mov    0x8(%ebp),%eax
  1005d1:	89 44 24 10          	mov    %eax,0x10(%esp)
  1005d5:	c7 44 24 0c 64 00 00 	movl   $0x64,0xc(%esp)
  1005dc:	00 
  1005dd:	8d 45 e0             	lea    -0x20(%ebp),%eax
  1005e0:	89 44 24 08          	mov    %eax,0x8(%esp)
  1005e4:	8d 45 e4             	lea    -0x1c(%ebp),%eax
  1005e7:	89 44 24 04          	mov    %eax,0x4(%esp)
  1005eb:	8b 45 f4             	mov    -0xc(%ebp),%eax
  1005ee:	89 04 24             	mov    %eax,(%esp)
  1005f1:	e8 e7 fd ff ff       	call   1003dd <stab_binsearch>
    if (lfile == 0)
  1005f6:	8b 45 e4             	mov    -0x1c(%ebp),%eax
  1005f9:	85 c0                	test   %eax,%eax
  1005fb:	75 0a                	jne    100607 <debuginfo_eip+0xd4>
        return -1;
  1005fd:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
  100602:	e9 67 02 00 00       	jmp    10086e <debuginfo_eip+0x33b>

    // Search within that file's stabs for the function definition
    // (N_FUN).
    int lfun = lfile, rfun = rfile;
  100607:	8b 45 e4             	mov    -0x1c(%ebp),%eax
  10060a:	89 45 dc             	mov    %eax,-0x24(%ebp)
  10060d:	8b 45 e0             	mov    -0x20(%ebp),%eax
  100610:	89 45 d8             	mov    %eax,-0x28(%ebp)
    int lline, rline;
    stab_binsearch(stabs, &lfun, &rfun, N_FUN, addr);
  100613:	8b 45 08             	mov    0x8(%ebp),%eax
  100616:	89 44 24 10          	mov    %eax,0x10(%esp)
  10061a:	c7 44 24 0c 24 00 00 	movl   $0x24,0xc(%esp)
  100621:	00 
  100622:	8d 45 d8             	lea    -0x28(%ebp),%eax
  100625:	89 44 24 08          	mov    %eax,0x8(%esp)
  100629:	8d 45 dc             	lea    -0x24(%ebp),%eax
  10062c:	89 44 24 04          	mov    %eax,0x4(%esp)
  100630:	8b 45 f4             	mov    -0xc(%ebp),%eax
  100633:	89 04 24             	mov    %eax,(%esp)
  100636:	e8 a2 fd ff ff       	call   1003dd <stab_binsearch>

    if (lfun <= rfun) {
  10063b:	8b 55 dc             	mov    -0x24(%ebp),%edx
  10063e:	8b 45 d8             	mov    -0x28(%ebp),%eax
  100641:	39 c2                	cmp    %eax,%edx
  100643:	7f 7c                	jg     1006c1 <debuginfo_eip+0x18e>
        // stabs[lfun] points to the function name
        // in the string table, but check bounds just in case.
        if (stabs[lfun].n_strx < stabstr_end - stabstr) {
  100645:	8b 45 dc             	mov    -0x24(%ebp),%eax
  100648:	89 c2                	mov    %eax,%edx
  10064a:	89 d0                	mov    %edx,%eax
  10064c:	01 c0                	add    %eax,%eax
  10064e:	01 d0                	add    %edx,%eax
  100650:	c1 e0 02             	shl    $0x2,%eax
  100653:	89 c2                	mov    %eax,%edx
  100655:	8b 45 f4             	mov    -0xc(%ebp),%eax
  100658:	01 d0                	add    %edx,%eax
  10065a:	8b 10                	mov    (%eax),%edx
  10065c:	8b 4d e8             	mov    -0x18(%ebp),%ecx
  10065f:	8b 45 ec             	mov    -0x14(%ebp),%eax
  100662:	29 c1                	sub    %eax,%ecx
  100664:	89 c8                	mov    %ecx,%eax
  100666:	39 c2                	cmp    %eax,%edx
  100668:	73 22                	jae    10068c <debuginfo_eip+0x159>
            info->eip_fn_name = stabstr + stabs[lfun].n_strx;
  10066a:	8b 45 dc             	mov    -0x24(%ebp),%eax
  10066d:	89 c2                	mov    %eax,%edx
  10066f:	89 d0                	mov    %edx,%eax
  100671:	01 c0                	add    %eax,%eax
  100673:	01 d0                	add    %edx,%eax
  100675:	c1 e0 02             	shl    $0x2,%eax
  100678:	89 c2                	mov    %eax,%edx
  10067a:	8b 45 f4             	mov    -0xc(%ebp),%eax
  10067d:	01 d0                	add    %edx,%eax
  10067f:	8b 10                	mov    (%eax),%edx
  100681:	8b 45 ec             	mov    -0x14(%ebp),%eax
  100684:	01 c2                	add    %eax,%edx
  100686:	8b 45 0c             	mov    0xc(%ebp),%eax
  100689:	89 50 08             	mov    %edx,0x8(%eax)
        }
        info->eip_fn_addr = stabs[lfun].n_value;
  10068c:	8b 45 dc             	mov    -0x24(%ebp),%eax
  10068f:	89 c2                	mov    %eax,%edx
  100691:	89 d0                	mov    %edx,%eax
  100693:	01 c0                	add    %eax,%eax
  100695:	01 d0                	add    %edx,%eax
  100697:	c1 e0 02             	shl    $0x2,%eax
  10069a:	89 c2                	mov    %eax,%edx
  10069c:	8b 45 f4             	mov    -0xc(%ebp),%eax
  10069f:	01 d0                	add    %edx,%eax
  1006a1:	8b 50 08             	mov    0x8(%eax),%edx
  1006a4:	8b 45 0c             	mov    0xc(%ebp),%eax
  1006a7:	89 50 10             	mov    %edx,0x10(%eax)
        addr -= info->eip_fn_addr;
  1006aa:	8b 45 0c             	mov    0xc(%ebp),%eax
  1006ad:	8b 40 10             	mov    0x10(%eax),%eax
  1006b0:	29 45 08             	sub    %eax,0x8(%ebp)
        // Search within the function definition for the line number.
        lline = lfun;
  1006b3:	8b 45 dc             	mov    -0x24(%ebp),%eax
  1006b6:	89 45 d4             	mov    %eax,-0x2c(%ebp)
        rline = rfun;
  1006b9:	8b 45 d8             	mov    -0x28(%ebp),%eax
  1006bc:	89 45 d0             	mov    %eax,-0x30(%ebp)
  1006bf:	eb 15                	jmp    1006d6 <debuginfo_eip+0x1a3>
    } else {
        // Couldn't find function stab!  Maybe we're in an assembly
        // file.  Search the whole file for the line number.
        info->eip_fn_addr = addr;
  1006c1:	8b 45 0c             	mov    0xc(%ebp),%eax
  1006c4:	8b 55 08             	mov    0x8(%ebp),%edx
  1006c7:	89 50 10             	mov    %edx,0x10(%eax)
        lline = lfile;
  1006ca:	8b 45 e4             	mov    -0x1c(%ebp),%eax
  1006cd:	89 45 d4             	mov    %eax,-0x2c(%ebp)
        rline = rfile;
  1006d0:	8b 45 e0             	mov    -0x20(%ebp),%eax
  1006d3:	89 45 d0             	mov    %eax,-0x30(%ebp)
    }
    info->eip_fn_namelen = strfind(info->eip_fn_name, ':') - info->eip_fn_name;
  1006d6:	8b 45 0c             	mov    0xc(%ebp),%eax
  1006d9:	8b 40 08             	mov    0x8(%eax),%eax
  1006dc:	c7 44 24 04 3a 00 00 	movl   $0x3a,0x4(%esp)
  1006e3:	00 
  1006e4:	89 04 24             	mov    %eax,(%esp)
  1006e7:	e8 31 56 00 00       	call   105d1d <strfind>
  1006ec:	89 c2                	mov    %eax,%edx
  1006ee:	8b 45 0c             	mov    0xc(%ebp),%eax
  1006f1:	8b 40 08             	mov    0x8(%eax),%eax
  1006f4:	29 c2                	sub    %eax,%edx
  1006f6:	8b 45 0c             	mov    0xc(%ebp),%eax
  1006f9:	89 50 0c             	mov    %edx,0xc(%eax)

    // Search within [lline, rline] for the line number stab.
    // If found, set info->eip_line to the right line number.
    // If not found, return -1.
    stab_binsearch(stabs, &lline, &rline, N_SLINE, addr);
  1006fc:	8b 45 08             	mov    0x8(%ebp),%eax
  1006ff:	89 44 24 10          	mov    %eax,0x10(%esp)
  100703:	c7 44 24 0c 44 00 00 	movl   $0x44,0xc(%esp)
  10070a:	00 
  10070b:	8d 45 d0             	lea    -0x30(%ebp),%eax
  10070e:	89 44 24 08          	mov    %eax,0x8(%esp)
  100712:	8d 45 d4             	lea    -0x2c(%ebp),%eax
  100715:	89 44 24 04          	mov    %eax,0x4(%esp)
  100719:	8b 45 f4             	mov    -0xc(%ebp),%eax
  10071c:	89 04 24             	mov    %eax,(%esp)
  10071f:	e8 b9 fc ff ff       	call   1003dd <stab_binsearch>
    if (lline <= rline) {
  100724:	8b 55 d4             	mov    -0x2c(%ebp),%edx
  100727:	8b 45 d0             	mov    -0x30(%ebp),%eax
  10072a:	39 c2                	cmp    %eax,%edx
  10072c:	7f 24                	jg     100752 <debuginfo_eip+0x21f>
        info->eip_line = stabs[rline].n_desc;
  10072e:	8b 45 d0             	mov    -0x30(%ebp),%eax
  100731:	89 c2                	mov    %eax,%edx
  100733:	89 d0                	mov    %edx,%eax
  100735:	01 c0                	add    %eax,%eax
  100737:	01 d0                	add    %edx,%eax
  100739:	c1 e0 02             	shl    $0x2,%eax
  10073c:	89 c2                	mov    %eax,%edx
  10073e:	8b 45 f4             	mov    -0xc(%ebp),%eax
  100741:	01 d0                	add    %edx,%eax
  100743:	0f b7 40 06          	movzwl 0x6(%eax),%eax
  100747:	0f b7 d0             	movzwl %ax,%edx
  10074a:	8b 45 0c             	mov    0xc(%ebp),%eax
  10074d:	89 50 04             	mov    %edx,0x4(%eax)

    // Search backwards from the line number for the relevant filename stab.
    // We can't just use the "lfile" stab because inlined functions
    // can interpolate code from a different file!
    // Such included source files use the N_SOL stab type.
    while (lline >= lfile
  100750:	eb 13                	jmp    100765 <debuginfo_eip+0x232>
    // If not found, return -1.
    stab_binsearch(stabs, &lline, &rline, N_SLINE, addr);
    if (lline <= rline) {
        info->eip_line = stabs[rline].n_desc;
    } else {
        return -1;
  100752:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
  100757:	e9 12 01 00 00       	jmp    10086e <debuginfo_eip+0x33b>
    // can interpolate code from a different file!
    // Such included source files use the N_SOL stab type.
    while (lline >= lfile
           && stabs[lline].n_type != N_SOL
           && (stabs[lline].n_type != N_SO || !stabs[lline].n_value)) {
        lline --;
  10075c:	8b 45 d4             	mov    -0x2c(%ebp),%eax
  10075f:	83 e8 01             	sub    $0x1,%eax
  100762:	89 45 d4             	mov    %eax,-0x2c(%ebp)

    // Search backwards from the line number for the relevant filename stab.
    // We can't just use the "lfile" stab because inlined functions
    // can interpolate code from a different file!
    // Such included source files use the N_SOL stab type.
    while (lline >= lfile
  100765:	8b 55 d4             	mov    -0x2c(%ebp),%edx
  100768:	8b 45 e4             	mov    -0x1c(%ebp),%eax
  10076b:	39 c2                	cmp    %eax,%edx
  10076d:	7c 56                	jl     1007c5 <debuginfo_eip+0x292>
           && stabs[lline].n_type != N_SOL
  10076f:	8b 45 d4             	mov    -0x2c(%ebp),%eax
  100772:	89 c2                	mov    %eax,%edx
  100774:	89 d0                	mov    %edx,%eax
  100776:	01 c0                	add    %eax,%eax
  100778:	01 d0                	add    %edx,%eax
  10077a:	c1 e0 02             	shl    $0x2,%eax
  10077d:	89 c2                	mov    %eax,%edx
  10077f:	8b 45 f4             	mov    -0xc(%ebp),%eax
  100782:	01 d0                	add    %edx,%eax
  100784:	0f b6 40 04          	movzbl 0x4(%eax),%eax
  100788:	3c 84                	cmp    $0x84,%al
  10078a:	74 39                	je     1007c5 <debuginfo_eip+0x292>
           && (stabs[lline].n_type != N_SO || !stabs[lline].n_value)) {
  10078c:	8b 45 d4             	mov    -0x2c(%ebp),%eax
  10078f:	89 c2                	mov    %eax,%edx
  100791:	89 d0                	mov    %edx,%eax
  100793:	01 c0                	add    %eax,%eax
  100795:	01 d0                	add    %edx,%eax
  100797:	c1 e0 02             	shl    $0x2,%eax
  10079a:	89 c2                	mov    %eax,%edx
  10079c:	8b 45 f4             	mov    -0xc(%ebp),%eax
  10079f:	01 d0                	add    %edx,%eax
  1007a1:	0f b6 40 04          	movzbl 0x4(%eax),%eax
  1007a5:	3c 64                	cmp    $0x64,%al
  1007a7:	75 b3                	jne    10075c <debuginfo_eip+0x229>
  1007a9:	8b 45 d4             	mov    -0x2c(%ebp),%eax
  1007ac:	89 c2                	mov    %eax,%edx
  1007ae:	89 d0                	mov    %edx,%eax
  1007b0:	01 c0                	add    %eax,%eax
  1007b2:	01 d0                	add    %edx,%eax
  1007b4:	c1 e0 02             	shl    $0x2,%eax
  1007b7:	89 c2                	mov    %eax,%edx
  1007b9:	8b 45 f4             	mov    -0xc(%ebp),%eax
  1007bc:	01 d0                	add    %edx,%eax
  1007be:	8b 40 08             	mov    0x8(%eax),%eax
  1007c1:	85 c0                	test   %eax,%eax
  1007c3:	74 97                	je     10075c <debuginfo_eip+0x229>
        lline --;
    }
    if (lline >= lfile && stabs[lline].n_strx < stabstr_end - stabstr) {
  1007c5:	8b 55 d4             	mov    -0x2c(%ebp),%edx
  1007c8:	8b 45 e4             	mov    -0x1c(%ebp),%eax
  1007cb:	39 c2                	cmp    %eax,%edx
  1007cd:	7c 46                	jl     100815 <debuginfo_eip+0x2e2>
  1007cf:	8b 45 d4             	mov    -0x2c(%ebp),%eax
  1007d2:	89 c2                	mov    %eax,%edx
  1007d4:	89 d0                	mov    %edx,%eax
  1007d6:	01 c0                	add    %eax,%eax
  1007d8:	01 d0                	add    %edx,%eax
  1007da:	c1 e0 02             	shl    $0x2,%eax
  1007dd:	89 c2                	mov    %eax,%edx
  1007df:	8b 45 f4             	mov    -0xc(%ebp),%eax
  1007e2:	01 d0                	add    %edx,%eax
  1007e4:	8b 10                	mov    (%eax),%edx
  1007e6:	8b 4d e8             	mov    -0x18(%ebp),%ecx
  1007e9:	8b 45 ec             	mov    -0x14(%ebp),%eax
  1007ec:	29 c1                	sub    %eax,%ecx
  1007ee:	89 c8                	mov    %ecx,%eax
  1007f0:	39 c2                	cmp    %eax,%edx
  1007f2:	73 21                	jae    100815 <debuginfo_eip+0x2e2>
        info->eip_file = stabstr + stabs[lline].n_strx;
  1007f4:	8b 45 d4             	mov    -0x2c(%ebp),%eax
  1007f7:	89 c2                	mov    %eax,%edx
  1007f9:	89 d0                	mov    %edx,%eax
  1007fb:	01 c0                	add    %eax,%eax
  1007fd:	01 d0                	add    %edx,%eax
  1007ff:	c1 e0 02             	shl    $0x2,%eax
  100802:	89 c2                	mov    %eax,%edx
  100804:	8b 45 f4             	mov    -0xc(%ebp),%eax
  100807:	01 d0                	add    %edx,%eax
  100809:	8b 10                	mov    (%eax),%edx
  10080b:	8b 45 ec             	mov    -0x14(%ebp),%eax
  10080e:	01 c2                	add    %eax,%edx
  100810:	8b 45 0c             	mov    0xc(%ebp),%eax
  100813:	89 10                	mov    %edx,(%eax)
    }

    // Set eip_fn_narg to the number of arguments taken by the function,
    // or 0 if there was no containing function.
    if (lfun < rfun) {
  100815:	8b 55 dc             	mov    -0x24(%ebp),%edx
  100818:	8b 45 d8             	mov    -0x28(%ebp),%eax
  10081b:	39 c2                	cmp    %eax,%edx
  10081d:	7d 4a                	jge    100869 <debuginfo_eip+0x336>
        for (lline = lfun + 1;
  10081f:	8b 45 dc             	mov    -0x24(%ebp),%eax
  100822:	83 c0 01             	add    $0x1,%eax
  100825:	89 45 d4             	mov    %eax,-0x2c(%ebp)
  100828:	eb 18                	jmp    100842 <debuginfo_eip+0x30f>
             lline < rfun && stabs[lline].n_type == N_PSYM;
             lline ++) {
            info->eip_fn_narg ++;
  10082a:	8b 45 0c             	mov    0xc(%ebp),%eax
  10082d:	8b 40 14             	mov    0x14(%eax),%eax
  100830:	8d 50 01             	lea    0x1(%eax),%edx
  100833:	8b 45 0c             	mov    0xc(%ebp),%eax
  100836:	89 50 14             	mov    %edx,0x14(%eax)
    // Set eip_fn_narg to the number of arguments taken by the function,
    // or 0 if there was no containing function.
    if (lfun < rfun) {
        for (lline = lfun + 1;
             lline < rfun && stabs[lline].n_type == N_PSYM;
             lline ++) {
  100839:	8b 45 d4             	mov    -0x2c(%ebp),%eax
  10083c:	83 c0 01             	add    $0x1,%eax
  10083f:	89 45 d4             	mov    %eax,-0x2c(%ebp)

    // Set eip_fn_narg to the number of arguments taken by the function,
    // or 0 if there was no containing function.
    if (lfun < rfun) {
        for (lline = lfun + 1;
             lline < rfun && stabs[lline].n_type == N_PSYM;
  100842:	8b 55 d4             	mov    -0x2c(%ebp),%edx
  100845:	8b 45 d8             	mov    -0x28(%ebp),%eax
    }

    // Set eip_fn_narg to the number of arguments taken by the function,
    // or 0 if there was no containing function.
    if (lfun < rfun) {
        for (lline = lfun + 1;
  100848:	39 c2                	cmp    %eax,%edx
  10084a:	7d 1d                	jge    100869 <debuginfo_eip+0x336>
             lline < rfun && stabs[lline].n_type == N_PSYM;
  10084c:	8b 45 d4             	mov    -0x2c(%ebp),%eax
  10084f:	89 c2                	mov    %eax,%edx
  100851:	89 d0                	mov    %edx,%eax
  100853:	01 c0                	add    %eax,%eax
  100855:	01 d0                	add    %edx,%eax
  100857:	c1 e0 02             	shl    $0x2,%eax
  10085a:	89 c2                	mov    %eax,%edx
  10085c:	8b 45 f4             	mov    -0xc(%ebp),%eax
  10085f:	01 d0                	add    %edx,%eax
  100861:	0f b6 40 04          	movzbl 0x4(%eax),%eax
  100865:	3c a0                	cmp    $0xa0,%al
  100867:	74 c1                	je     10082a <debuginfo_eip+0x2f7>
             lline ++) {
            info->eip_fn_narg ++;
        }
    }
    return 0;
  100869:	b8 00 00 00 00       	mov    $0x0,%eax
}
  10086e:	c9                   	leave  
  10086f:	c3                   	ret    

00100870 <print_kerninfo>:
 * print_kerninfo - print the information about kernel, including the location
 * of kernel entry, the start addresses of data and text segements, the start
 * address of free memory and how many memory that kernel has used.
 * */
void
print_kerninfo(void) {
  100870:	55                   	push   %ebp
  100871:	89 e5                	mov    %esp,%ebp
  100873:	83 ec 18             	sub    $0x18,%esp
    extern char etext[], edata[], end[], kern_init[];
    cprintf("Special kernel symbols:\n");
  100876:	c7 04 24 f6 60 10 00 	movl   $0x1060f6,(%esp)
  10087d:	e8 ba fa ff ff       	call   10033c <cprintf>
    cprintf("  entry  0x%08x (phys)\n", kern_init);
  100882:	c7 44 24 04 2a 00 10 	movl   $0x10002a,0x4(%esp)
  100889:	00 
  10088a:	c7 04 24 0f 61 10 00 	movl   $0x10610f,(%esp)
  100891:	e8 a6 fa ff ff       	call   10033c <cprintf>
    cprintf("  etext  0x%08x (phys)\n", etext);
  100896:	c7 44 24 04 32 60 10 	movl   $0x106032,0x4(%esp)
  10089d:	00 
  10089e:	c7 04 24 27 61 10 00 	movl   $0x106127,(%esp)
  1008a5:	e8 92 fa ff ff       	call   10033c <cprintf>
    cprintf("  edata  0x%08x (phys)\n", edata);
  1008aa:	c7 44 24 04 36 7a 11 	movl   $0x117a36,0x4(%esp)
  1008b1:	00 
  1008b2:	c7 04 24 3f 61 10 00 	movl   $0x10613f,(%esp)
  1008b9:	e8 7e fa ff ff       	call   10033c <cprintf>
    cprintf("  end    0x%08x (phys)\n", end);
  1008be:	c7 44 24 04 c8 89 11 	movl   $0x1189c8,0x4(%esp)
  1008c5:	00 
  1008c6:	c7 04 24 57 61 10 00 	movl   $0x106157,(%esp)
  1008cd:	e8 6a fa ff ff       	call   10033c <cprintf>
    cprintf("Kernel executable memory footprint: %dKB\n", (end - kern_init + 1023)/1024);
  1008d2:	b8 c8 89 11 00       	mov    $0x1189c8,%eax
  1008d7:	8d 90 ff 03 00 00    	lea    0x3ff(%eax),%edx
  1008dd:	b8 2a 00 10 00       	mov    $0x10002a,%eax
  1008e2:	29 c2                	sub    %eax,%edx
  1008e4:	89 d0                	mov    %edx,%eax
  1008e6:	8d 90 ff 03 00 00    	lea    0x3ff(%eax),%edx
  1008ec:	85 c0                	test   %eax,%eax
  1008ee:	0f 48 c2             	cmovs  %edx,%eax
  1008f1:	c1 f8 0a             	sar    $0xa,%eax
  1008f4:	89 44 24 04          	mov    %eax,0x4(%esp)
  1008f8:	c7 04 24 70 61 10 00 	movl   $0x106170,(%esp)
  1008ff:	e8 38 fa ff ff       	call   10033c <cprintf>
}
  100904:	c9                   	leave  
  100905:	c3                   	ret    

00100906 <print_debuginfo>:
/* *
 * print_debuginfo - read and print the stat information for the address @eip,
 * and info.eip_fn_addr should be the first address of the related function.
 * */
void
print_debuginfo(uintptr_t eip) {
  100906:	55                   	push   %ebp
  100907:	89 e5                	mov    %esp,%ebp
  100909:	81 ec 48 01 00 00    	sub    $0x148,%esp
    struct eipdebuginfo info;
    if (debuginfo_eip(eip, &info) != 0) {
  10090f:	8d 45 dc             	lea    -0x24(%ebp),%eax
  100912:	89 44 24 04          	mov    %eax,0x4(%esp)
  100916:	8b 45 08             	mov    0x8(%ebp),%eax
  100919:	89 04 24             	mov    %eax,(%esp)
  10091c:	e8 12 fc ff ff       	call   100533 <debuginfo_eip>
  100921:	85 c0                	test   %eax,%eax
  100923:	74 15                	je     10093a <print_debuginfo+0x34>
        cprintf("    <unknow>: -- 0x%08x --\n", eip);
  100925:	8b 45 08             	mov    0x8(%ebp),%eax
  100928:	89 44 24 04          	mov    %eax,0x4(%esp)
  10092c:	c7 04 24 9a 61 10 00 	movl   $0x10619a,(%esp)
  100933:	e8 04 fa ff ff       	call   10033c <cprintf>
  100938:	eb 6d                	jmp    1009a7 <print_debuginfo+0xa1>
    }
    else {
        char fnname[256];
        int j;
        for (j = 0; j < info.eip_fn_namelen; j ++) {
  10093a:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)
  100941:	eb 1c                	jmp    10095f <print_debuginfo+0x59>
            fnname[j] = info.eip_fn_name[j];
  100943:	8b 55 e4             	mov    -0x1c(%ebp),%edx
  100946:	8b 45 f4             	mov    -0xc(%ebp),%eax
  100949:	01 d0                	add    %edx,%eax
  10094b:	0f b6 00             	movzbl (%eax),%eax
  10094e:	8d 8d dc fe ff ff    	lea    -0x124(%ebp),%ecx
  100954:	8b 55 f4             	mov    -0xc(%ebp),%edx
  100957:	01 ca                	add    %ecx,%edx
  100959:	88 02                	mov    %al,(%edx)
        cprintf("    <unknow>: -- 0x%08x --\n", eip);
    }
    else {
        char fnname[256];
        int j;
        for (j = 0; j < info.eip_fn_namelen; j ++) {
  10095b:	83 45 f4 01          	addl   $0x1,-0xc(%ebp)
  10095f:	8b 45 e8             	mov    -0x18(%ebp),%eax
  100962:	3b 45 f4             	cmp    -0xc(%ebp),%eax
  100965:	7f dc                	jg     100943 <print_debuginfo+0x3d>
            fnname[j] = info.eip_fn_name[j];
        }
        fnname[j] = '\0';
  100967:	8d 95 dc fe ff ff    	lea    -0x124(%ebp),%edx
  10096d:	8b 45 f4             	mov    -0xc(%ebp),%eax
  100970:	01 d0                	add    %edx,%eax
  100972:	c6 00 00             	movb   $0x0,(%eax)
        cprintf("    %s:%d: %s+%d\n", info.eip_file, info.eip_line,
                fnname, eip - info.eip_fn_addr);
  100975:	8b 45 ec             	mov    -0x14(%ebp),%eax
        int j;
        for (j = 0; j < info.eip_fn_namelen; j ++) {
            fnname[j] = info.eip_fn_name[j];
        }
        fnname[j] = '\0';
        cprintf("    %s:%d: %s+%d\n", info.eip_file, info.eip_line,
  100978:	8b 55 08             	mov    0x8(%ebp),%edx
  10097b:	89 d1                	mov    %edx,%ecx
  10097d:	29 c1                	sub    %eax,%ecx
  10097f:	8b 55 e0             	mov    -0x20(%ebp),%edx
  100982:	8b 45 dc             	mov    -0x24(%ebp),%eax
  100985:	89 4c 24 10          	mov    %ecx,0x10(%esp)
  100989:	8d 8d dc fe ff ff    	lea    -0x124(%ebp),%ecx
  10098f:	89 4c 24 0c          	mov    %ecx,0xc(%esp)
  100993:	89 54 24 08          	mov    %edx,0x8(%esp)
  100997:	89 44 24 04          	mov    %eax,0x4(%esp)
  10099b:	c7 04 24 b6 61 10 00 	movl   $0x1061b6,(%esp)
  1009a2:	e8 95 f9 ff ff       	call   10033c <cprintf>
                fnname, eip - info.eip_fn_addr);
    }
}
  1009a7:	c9                   	leave  
  1009a8:	c3                   	ret    

001009a9 <read_eip>:

static __noinline uint32_t
read_eip(void) {
  1009a9:	55                   	push   %ebp
  1009aa:	89 e5                	mov    %esp,%ebp
  1009ac:	83 ec 10             	sub    $0x10,%esp
    uint32_t eip;
    asm volatile("movl 4(%%ebp), %0" : "=r" (eip));
  1009af:	8b 45 04             	mov    0x4(%ebp),%eax
  1009b2:	89 45 fc             	mov    %eax,-0x4(%ebp)
    return eip;
  1009b5:	8b 45 fc             	mov    -0x4(%ebp),%eax
}
  1009b8:	c9                   	leave  
  1009b9:	c3                   	ret    

001009ba <print_stackframe>:
 *
 * Note that, the length of ebp-chain is limited. In boot/bootasm.S, before jumping
 * to the kernel entry, the value of ebp has been set to zero, that's the boundary.
 * */
void
print_stackframe(void) {
  1009ba:	55                   	push   %ebp
  1009bb:	89 e5                	mov    %esp,%ebp
  1009bd:	83 ec 38             	sub    $0x38,%esp
}

static inline uint32_t
read_ebp(void) {
    uint32_t ebp;
    asm volatile ("movl %%ebp, %0" : "=r" (ebp));
  1009c0:	89 e8                	mov    %ebp,%eax
  1009c2:	89 45 e0             	mov    %eax,-0x20(%ebp)
    return ebp;
  1009c5:	8b 45 e0             	mov    -0x20(%ebp),%eax
      *    (3.4) call print_debuginfo(eip-1) to print the C calling function name and line number, etc.
      *    (3.5) popup a calling stackframe
      *           NOTICE: the calling funciton's return addr eip  = ss:[ebp+4]
      *                   the calling funciton's ebp = ss:[ebp]
      */
uint32_t ebp = read_ebp();
  1009c8:	89 45 f4             	mov    %eax,-0xc(%ebp)
    uint32_t eip = read_eip();
  1009cb:	e8 d9 ff ff ff       	call   1009a9 <read_eip>
  1009d0:	89 45 f0             	mov    %eax,-0x10(%ebp)
    uint32_t *arguments;
    int i,j;
    for(i = 0; i<STACKFRAME_DEPTH&&ebp; i++){
  1009d3:	c7 45 ec 00 00 00 00 	movl   $0x0,-0x14(%ebp)
  1009da:	e9 88 00 00 00       	jmp    100a67 <print_stackframe+0xad>
	cprintf("ebp:0x%08x eip:0x%08x args:", ebp, eip);//输出ebp和eip
  1009df:	8b 45 f0             	mov    -0x10(%ebp),%eax
  1009e2:	89 44 24 08          	mov    %eax,0x8(%esp)
  1009e6:	8b 45 f4             	mov    -0xc(%ebp),%eax
  1009e9:	89 44 24 04          	mov    %eax,0x4(%esp)
  1009ed:	c7 04 24 c8 61 10 00 	movl   $0x1061c8,(%esp)
  1009f4:	e8 43 f9 ff ff       	call   10033c <cprintf>
	arguments = (uint32_t *)ebp + 2;                 //接收ebp+2的地址，获得参数
  1009f9:	8b 45 f4             	mov    -0xc(%ebp),%eax
  1009fc:	83 c0 08             	add    $0x8,%eax
  1009ff:	89 45 e4             	mov    %eax,-0x1c(%ebp)
	for(j=0; j<4; j++){
  100a02:	c7 45 e8 00 00 00 00 	movl   $0x0,-0x18(%ebp)
  100a09:	eb 25                	jmp    100a30 <print_stackframe+0x76>
		cprintf("0x%08x ", arguments[j]);	 //输出每一参数		
  100a0b:	8b 45 e8             	mov    -0x18(%ebp),%eax
  100a0e:	8d 14 85 00 00 00 00 	lea    0x0(,%eax,4),%edx
  100a15:	8b 45 e4             	mov    -0x1c(%ebp),%eax
  100a18:	01 d0                	add    %edx,%eax
  100a1a:	8b 00                	mov    (%eax),%eax
  100a1c:	89 44 24 04          	mov    %eax,0x4(%esp)
  100a20:	c7 04 24 e4 61 10 00 	movl   $0x1061e4,(%esp)
  100a27:	e8 10 f9 ff ff       	call   10033c <cprintf>
    uint32_t *arguments;
    int i,j;
    for(i = 0; i<STACKFRAME_DEPTH&&ebp; i++){
	cprintf("ebp:0x%08x eip:0x%08x args:", ebp, eip);//输出ebp和eip
	arguments = (uint32_t *)ebp + 2;                 //接收ebp+2的地址，获得参数
	for(j=0; j<4; j++){
  100a2c:	83 45 e8 01          	addl   $0x1,-0x18(%ebp)
  100a30:	83 7d e8 03          	cmpl   $0x3,-0x18(%ebp)
  100a34:	7e d5                	jle    100a0b <print_stackframe+0x51>
		cprintf("0x%08x ", arguments[j]);	 //输出每一参数		
	}
	cprintf("\n");
  100a36:	c7 04 24 ec 61 10 00 	movl   $0x1061ec,(%esp)
  100a3d:	e8 fa f8 ff ff       	call   10033c <cprintf>
	print_debuginfo(eip-1);				 //输出caller的信息
  100a42:	8b 45 f0             	mov    -0x10(%ebp),%eax
  100a45:	83 e8 01             	sub    $0x1,%eax
  100a48:	89 04 24             	mov    %eax,(%esp)
  100a4b:	e8 b6 fe ff ff       	call   100906 <print_debuginfo>
	eip = ((uint32_t *)ebp)[1];                      //更新ebp和eip
  100a50:	8b 45 f4             	mov    -0xc(%ebp),%eax
  100a53:	83 c0 04             	add    $0x4,%eax
  100a56:	8b 00                	mov    (%eax),%eax
  100a58:	89 45 f0             	mov    %eax,-0x10(%ebp)
	ebp = ((uint32_t *)ebp)[0];
  100a5b:	8b 45 f4             	mov    -0xc(%ebp),%eax
  100a5e:	8b 00                	mov    (%eax),%eax
  100a60:	89 45 f4             	mov    %eax,-0xc(%ebp)
      */
uint32_t ebp = read_ebp();
    uint32_t eip = read_eip();
    uint32_t *arguments;
    int i,j;
    for(i = 0; i<STACKFRAME_DEPTH&&ebp; i++){
  100a63:	83 45 ec 01          	addl   $0x1,-0x14(%ebp)
  100a67:	83 7d ec 13          	cmpl   $0x13,-0x14(%ebp)
  100a6b:	7f 0a                	jg     100a77 <print_stackframe+0xbd>
  100a6d:	83 7d f4 00          	cmpl   $0x0,-0xc(%ebp)
  100a71:	0f 85 68 ff ff ff    	jne    1009df <print_stackframe+0x25>
	cprintf("\n");
	print_debuginfo(eip-1);				 //输出caller的信息
	eip = ((uint32_t *)ebp)[1];                      //更新ebp和eip
	ebp = ((uint32_t *)ebp)[0];
   }
}
  100a77:	c9                   	leave  
  100a78:	c3                   	ret    

00100a79 <parse>:
#define MAXARGS         16
#define WHITESPACE      " \t\n\r"

/* parse - parse the command buffer into whitespace-separated arguments */
static int
parse(char *buf, char **argv) {
  100a79:	55                   	push   %ebp
  100a7a:	89 e5                	mov    %esp,%ebp
  100a7c:	83 ec 28             	sub    $0x28,%esp
    int argc = 0;
  100a7f:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)
    while (1) {
        // find global whitespace
        while (*buf != '\0' && strchr(WHITESPACE, *buf) != NULL) {
  100a86:	eb 0c                	jmp    100a94 <parse+0x1b>
            *buf ++ = '\0';
  100a88:	8b 45 08             	mov    0x8(%ebp),%eax
  100a8b:	8d 50 01             	lea    0x1(%eax),%edx
  100a8e:	89 55 08             	mov    %edx,0x8(%ebp)
  100a91:	c6 00 00             	movb   $0x0,(%eax)
static int
parse(char *buf, char **argv) {
    int argc = 0;
    while (1) {
        // find global whitespace
        while (*buf != '\0' && strchr(WHITESPACE, *buf) != NULL) {
  100a94:	8b 45 08             	mov    0x8(%ebp),%eax
  100a97:	0f b6 00             	movzbl (%eax),%eax
  100a9a:	84 c0                	test   %al,%al
  100a9c:	74 1d                	je     100abb <parse+0x42>
  100a9e:	8b 45 08             	mov    0x8(%ebp),%eax
  100aa1:	0f b6 00             	movzbl (%eax),%eax
  100aa4:	0f be c0             	movsbl %al,%eax
  100aa7:	89 44 24 04          	mov    %eax,0x4(%esp)
  100aab:	c7 04 24 70 62 10 00 	movl   $0x106270,(%esp)
  100ab2:	e8 33 52 00 00       	call   105cea <strchr>
  100ab7:	85 c0                	test   %eax,%eax
  100ab9:	75 cd                	jne    100a88 <parse+0xf>
            *buf ++ = '\0';
        }
        if (*buf == '\0') {
  100abb:	8b 45 08             	mov    0x8(%ebp),%eax
  100abe:	0f b6 00             	movzbl (%eax),%eax
  100ac1:	84 c0                	test   %al,%al
  100ac3:	75 02                	jne    100ac7 <parse+0x4e>
            break;
  100ac5:	eb 67                	jmp    100b2e <parse+0xb5>
        }

        // save and scan past next arg
        if (argc == MAXARGS - 1) {
  100ac7:	83 7d f4 0f          	cmpl   $0xf,-0xc(%ebp)
  100acb:	75 14                	jne    100ae1 <parse+0x68>
            cprintf("Too many arguments (max %d).\n", MAXARGS);
  100acd:	c7 44 24 04 10 00 00 	movl   $0x10,0x4(%esp)
  100ad4:	00 
  100ad5:	c7 04 24 75 62 10 00 	movl   $0x106275,(%esp)
  100adc:	e8 5b f8 ff ff       	call   10033c <cprintf>
        }
        argv[argc ++] = buf;
  100ae1:	8b 45 f4             	mov    -0xc(%ebp),%eax
  100ae4:	8d 50 01             	lea    0x1(%eax),%edx
  100ae7:	89 55 f4             	mov    %edx,-0xc(%ebp)
  100aea:	8d 14 85 00 00 00 00 	lea    0x0(,%eax,4),%edx
  100af1:	8b 45 0c             	mov    0xc(%ebp),%eax
  100af4:	01 c2                	add    %eax,%edx
  100af6:	8b 45 08             	mov    0x8(%ebp),%eax
  100af9:	89 02                	mov    %eax,(%edx)
        while (*buf != '\0' && strchr(WHITESPACE, *buf) == NULL) {
  100afb:	eb 04                	jmp    100b01 <parse+0x88>
            buf ++;
  100afd:	83 45 08 01          	addl   $0x1,0x8(%ebp)
        // save and scan past next arg
        if (argc == MAXARGS - 1) {
            cprintf("Too many arguments (max %d).\n", MAXARGS);
        }
        argv[argc ++] = buf;
        while (*buf != '\0' && strchr(WHITESPACE, *buf) == NULL) {
  100b01:	8b 45 08             	mov    0x8(%ebp),%eax
  100b04:	0f b6 00             	movzbl (%eax),%eax
  100b07:	84 c0                	test   %al,%al
  100b09:	74 1d                	je     100b28 <parse+0xaf>
  100b0b:	8b 45 08             	mov    0x8(%ebp),%eax
  100b0e:	0f b6 00             	movzbl (%eax),%eax
  100b11:	0f be c0             	movsbl %al,%eax
  100b14:	89 44 24 04          	mov    %eax,0x4(%esp)
  100b18:	c7 04 24 70 62 10 00 	movl   $0x106270,(%esp)
  100b1f:	e8 c6 51 00 00       	call   105cea <strchr>
  100b24:	85 c0                	test   %eax,%eax
  100b26:	74 d5                	je     100afd <parse+0x84>
            buf ++;
        }
    }
  100b28:	90                   	nop
static int
parse(char *buf, char **argv) {
    int argc = 0;
    while (1) {
        // find global whitespace
        while (*buf != '\0' && strchr(WHITESPACE, *buf) != NULL) {
  100b29:	e9 66 ff ff ff       	jmp    100a94 <parse+0x1b>
        argv[argc ++] = buf;
        while (*buf != '\0' && strchr(WHITESPACE, *buf) == NULL) {
            buf ++;
        }
    }
    return argc;
  100b2e:	8b 45 f4             	mov    -0xc(%ebp),%eax
}
  100b31:	c9                   	leave  
  100b32:	c3                   	ret    

00100b33 <runcmd>:
/* *
 * runcmd - parse the input string, split it into separated arguments
 * and then lookup and invoke some related commands/
 * */
static int
runcmd(char *buf, struct trapframe *tf) {
  100b33:	55                   	push   %ebp
  100b34:	89 e5                	mov    %esp,%ebp
  100b36:	83 ec 68             	sub    $0x68,%esp
    char *argv[MAXARGS];
    int argc = parse(buf, argv);
  100b39:	8d 45 b0             	lea    -0x50(%ebp),%eax
  100b3c:	89 44 24 04          	mov    %eax,0x4(%esp)
  100b40:	8b 45 08             	mov    0x8(%ebp),%eax
  100b43:	89 04 24             	mov    %eax,(%esp)
  100b46:	e8 2e ff ff ff       	call   100a79 <parse>
  100b4b:	89 45 f0             	mov    %eax,-0x10(%ebp)
    if (argc == 0) {
  100b4e:	83 7d f0 00          	cmpl   $0x0,-0x10(%ebp)
  100b52:	75 0a                	jne    100b5e <runcmd+0x2b>
        return 0;
  100b54:	b8 00 00 00 00       	mov    $0x0,%eax
  100b59:	e9 85 00 00 00       	jmp    100be3 <runcmd+0xb0>
    }
    int i;
    for (i = 0; i < NCOMMANDS; i ++) {
  100b5e:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)
  100b65:	eb 5c                	jmp    100bc3 <runcmd+0x90>
        if (strcmp(commands[i].name, argv[0]) == 0) {
  100b67:	8b 4d b0             	mov    -0x50(%ebp),%ecx
  100b6a:	8b 55 f4             	mov    -0xc(%ebp),%edx
  100b6d:	89 d0                	mov    %edx,%eax
  100b6f:	01 c0                	add    %eax,%eax
  100b71:	01 d0                	add    %edx,%eax
  100b73:	c1 e0 02             	shl    $0x2,%eax
  100b76:	05 20 70 11 00       	add    $0x117020,%eax
  100b7b:	8b 00                	mov    (%eax),%eax
  100b7d:	89 4c 24 04          	mov    %ecx,0x4(%esp)
  100b81:	89 04 24             	mov    %eax,(%esp)
  100b84:	e8 c2 50 00 00       	call   105c4b <strcmp>
  100b89:	85 c0                	test   %eax,%eax
  100b8b:	75 32                	jne    100bbf <runcmd+0x8c>
            return commands[i].func(argc - 1, argv + 1, tf);
  100b8d:	8b 55 f4             	mov    -0xc(%ebp),%edx
  100b90:	89 d0                	mov    %edx,%eax
  100b92:	01 c0                	add    %eax,%eax
  100b94:	01 d0                	add    %edx,%eax
  100b96:	c1 e0 02             	shl    $0x2,%eax
  100b99:	05 20 70 11 00       	add    $0x117020,%eax
  100b9e:	8b 40 08             	mov    0x8(%eax),%eax
  100ba1:	8b 55 f0             	mov    -0x10(%ebp),%edx
  100ba4:	8d 4a ff             	lea    -0x1(%edx),%ecx
  100ba7:	8b 55 0c             	mov    0xc(%ebp),%edx
  100baa:	89 54 24 08          	mov    %edx,0x8(%esp)
  100bae:	8d 55 b0             	lea    -0x50(%ebp),%edx
  100bb1:	83 c2 04             	add    $0x4,%edx
  100bb4:	89 54 24 04          	mov    %edx,0x4(%esp)
  100bb8:	89 0c 24             	mov    %ecx,(%esp)
  100bbb:	ff d0                	call   *%eax
  100bbd:	eb 24                	jmp    100be3 <runcmd+0xb0>
    int argc = parse(buf, argv);
    if (argc == 0) {
        return 0;
    }
    int i;
    for (i = 0; i < NCOMMANDS; i ++) {
  100bbf:	83 45 f4 01          	addl   $0x1,-0xc(%ebp)
  100bc3:	8b 45 f4             	mov    -0xc(%ebp),%eax
  100bc6:	83 f8 02             	cmp    $0x2,%eax
  100bc9:	76 9c                	jbe    100b67 <runcmd+0x34>
        if (strcmp(commands[i].name, argv[0]) == 0) {
            return commands[i].func(argc - 1, argv + 1, tf);
        }
    }
    cprintf("Unknown command '%s'\n", argv[0]);
  100bcb:	8b 45 b0             	mov    -0x50(%ebp),%eax
  100bce:	89 44 24 04          	mov    %eax,0x4(%esp)
  100bd2:	c7 04 24 93 62 10 00 	movl   $0x106293,(%esp)
  100bd9:	e8 5e f7 ff ff       	call   10033c <cprintf>
    return 0;
  100bde:	b8 00 00 00 00       	mov    $0x0,%eax
}
  100be3:	c9                   	leave  
  100be4:	c3                   	ret    

00100be5 <kmonitor>:

/***** Implementations of basic kernel monitor commands *****/

void
kmonitor(struct trapframe *tf) {
  100be5:	55                   	push   %ebp
  100be6:	89 e5                	mov    %esp,%ebp
  100be8:	83 ec 28             	sub    $0x28,%esp
    cprintf("Welcome to the kernel debug monitor!!\n");
  100beb:	c7 04 24 ac 62 10 00 	movl   $0x1062ac,(%esp)
  100bf2:	e8 45 f7 ff ff       	call   10033c <cprintf>
    cprintf("Type 'help' for a list of commands.\n");
  100bf7:	c7 04 24 d4 62 10 00 	movl   $0x1062d4,(%esp)
  100bfe:	e8 39 f7 ff ff       	call   10033c <cprintf>

    if (tf != NULL) {
  100c03:	83 7d 08 00          	cmpl   $0x0,0x8(%ebp)
  100c07:	74 0b                	je     100c14 <kmonitor+0x2f>
        print_trapframe(tf);
  100c09:	8b 45 08             	mov    0x8(%ebp),%eax
  100c0c:	89 04 24             	mov    %eax,(%esp)
  100c0f:	e8 30 0e 00 00       	call   101a44 <print_trapframe>
    }

    char *buf;
    while (1) {
        if ((buf = readline("K> ")) != NULL) {
  100c14:	c7 04 24 f9 62 10 00 	movl   $0x1062f9,(%esp)
  100c1b:	e8 13 f6 ff ff       	call   100233 <readline>
  100c20:	89 45 f4             	mov    %eax,-0xc(%ebp)
  100c23:	83 7d f4 00          	cmpl   $0x0,-0xc(%ebp)
  100c27:	74 18                	je     100c41 <kmonitor+0x5c>
            if (runcmd(buf, tf) < 0) {
  100c29:	8b 45 08             	mov    0x8(%ebp),%eax
  100c2c:	89 44 24 04          	mov    %eax,0x4(%esp)
  100c30:	8b 45 f4             	mov    -0xc(%ebp),%eax
  100c33:	89 04 24             	mov    %eax,(%esp)
  100c36:	e8 f8 fe ff ff       	call   100b33 <runcmd>
  100c3b:	85 c0                	test   %eax,%eax
  100c3d:	79 02                	jns    100c41 <kmonitor+0x5c>
                break;
  100c3f:	eb 02                	jmp    100c43 <kmonitor+0x5e>
            }
        }
    }
  100c41:	eb d1                	jmp    100c14 <kmonitor+0x2f>
}
  100c43:	c9                   	leave  
  100c44:	c3                   	ret    

00100c45 <mon_help>:

/* mon_help - print the information about mon_* functions */
int
mon_help(int argc, char **argv, struct trapframe *tf) {
  100c45:	55                   	push   %ebp
  100c46:	89 e5                	mov    %esp,%ebp
  100c48:	83 ec 28             	sub    $0x28,%esp
    int i;
    for (i = 0; i < NCOMMANDS; i ++) {
  100c4b:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)
  100c52:	eb 3f                	jmp    100c93 <mon_help+0x4e>
        cprintf("%s - %s\n", commands[i].name, commands[i].desc);
  100c54:	8b 55 f4             	mov    -0xc(%ebp),%edx
  100c57:	89 d0                	mov    %edx,%eax
  100c59:	01 c0                	add    %eax,%eax
  100c5b:	01 d0                	add    %edx,%eax
  100c5d:	c1 e0 02             	shl    $0x2,%eax
  100c60:	05 20 70 11 00       	add    $0x117020,%eax
  100c65:	8b 48 04             	mov    0x4(%eax),%ecx
  100c68:	8b 55 f4             	mov    -0xc(%ebp),%edx
  100c6b:	89 d0                	mov    %edx,%eax
  100c6d:	01 c0                	add    %eax,%eax
  100c6f:	01 d0                	add    %edx,%eax
  100c71:	c1 e0 02             	shl    $0x2,%eax
  100c74:	05 20 70 11 00       	add    $0x117020,%eax
  100c79:	8b 00                	mov    (%eax),%eax
  100c7b:	89 4c 24 08          	mov    %ecx,0x8(%esp)
  100c7f:	89 44 24 04          	mov    %eax,0x4(%esp)
  100c83:	c7 04 24 fd 62 10 00 	movl   $0x1062fd,(%esp)
  100c8a:	e8 ad f6 ff ff       	call   10033c <cprintf>

/* mon_help - print the information about mon_* functions */
int
mon_help(int argc, char **argv, struct trapframe *tf) {
    int i;
    for (i = 0; i < NCOMMANDS; i ++) {
  100c8f:	83 45 f4 01          	addl   $0x1,-0xc(%ebp)
  100c93:	8b 45 f4             	mov    -0xc(%ebp),%eax
  100c96:	83 f8 02             	cmp    $0x2,%eax
  100c99:	76 b9                	jbe    100c54 <mon_help+0xf>
        cprintf("%s - %s\n", commands[i].name, commands[i].desc);
    }
    return 0;
  100c9b:	b8 00 00 00 00       	mov    $0x0,%eax
}
  100ca0:	c9                   	leave  
  100ca1:	c3                   	ret    

00100ca2 <mon_kerninfo>:
/* *
 * mon_kerninfo - call print_kerninfo in kern/debug/kdebug.c to
 * print the memory occupancy in kernel.
 * */
int
mon_kerninfo(int argc, char **argv, struct trapframe *tf) {
  100ca2:	55                   	push   %ebp
  100ca3:	89 e5                	mov    %esp,%ebp
  100ca5:	83 ec 08             	sub    $0x8,%esp
    print_kerninfo();
  100ca8:	e8 c3 fb ff ff       	call   100870 <print_kerninfo>
    return 0;
  100cad:	b8 00 00 00 00       	mov    $0x0,%eax
}
  100cb2:	c9                   	leave  
  100cb3:	c3                   	ret    

00100cb4 <mon_backtrace>:
/* *
 * mon_backtrace - call print_stackframe in kern/debug/kdebug.c to
 * print a backtrace of the stack.
 * */
int
mon_backtrace(int argc, char **argv, struct trapframe *tf) {
  100cb4:	55                   	push   %ebp
  100cb5:	89 e5                	mov    %esp,%ebp
  100cb7:	83 ec 08             	sub    $0x8,%esp
    print_stackframe();
  100cba:	e8 fb fc ff ff       	call   1009ba <print_stackframe>
    return 0;
  100cbf:	b8 00 00 00 00       	mov    $0x0,%eax
}
  100cc4:	c9                   	leave  
  100cc5:	c3                   	ret    

00100cc6 <__panic>:
/* *
 * __panic - __panic is called on unresolvable fatal errors. it prints
 * "panic: 'message'", and then enters the kernel monitor.
 * */
void
__panic(const char *file, int line, const char *fmt, ...) {
  100cc6:	55                   	push   %ebp
  100cc7:	89 e5                	mov    %esp,%ebp
  100cc9:	83 ec 28             	sub    $0x28,%esp
    if (is_panic) {
  100ccc:	a1 60 7e 11 00       	mov    0x117e60,%eax
  100cd1:	85 c0                	test   %eax,%eax
  100cd3:	74 02                	je     100cd7 <__panic+0x11>
        goto panic_dead;
  100cd5:	eb 48                	jmp    100d1f <__panic+0x59>
    }
    is_panic = 1;
  100cd7:	c7 05 60 7e 11 00 01 	movl   $0x1,0x117e60
  100cde:	00 00 00 

    // print the 'message'
    va_list ap;
    va_start(ap, fmt);
  100ce1:	8d 45 14             	lea    0x14(%ebp),%eax
  100ce4:	89 45 f4             	mov    %eax,-0xc(%ebp)
    cprintf("kernel panic at %s:%d:\n    ", file, line);
  100ce7:	8b 45 0c             	mov    0xc(%ebp),%eax
  100cea:	89 44 24 08          	mov    %eax,0x8(%esp)
  100cee:	8b 45 08             	mov    0x8(%ebp),%eax
  100cf1:	89 44 24 04          	mov    %eax,0x4(%esp)
  100cf5:	c7 04 24 06 63 10 00 	movl   $0x106306,(%esp)
  100cfc:	e8 3b f6 ff ff       	call   10033c <cprintf>
    vcprintf(fmt, ap);
  100d01:	8b 45 f4             	mov    -0xc(%ebp),%eax
  100d04:	89 44 24 04          	mov    %eax,0x4(%esp)
  100d08:	8b 45 10             	mov    0x10(%ebp),%eax
  100d0b:	89 04 24             	mov    %eax,(%esp)
  100d0e:	e8 f6 f5 ff ff       	call   100309 <vcprintf>
    cprintf("\n");
  100d13:	c7 04 24 22 63 10 00 	movl   $0x106322,(%esp)
  100d1a:	e8 1d f6 ff ff       	call   10033c <cprintf>
    va_end(ap);

panic_dead:
    intr_disable();
  100d1f:	e8 85 09 00 00       	call   1016a9 <intr_disable>
    while (1) {
        kmonitor(NULL);
  100d24:	c7 04 24 00 00 00 00 	movl   $0x0,(%esp)
  100d2b:	e8 b5 fe ff ff       	call   100be5 <kmonitor>
    }
  100d30:	eb f2                	jmp    100d24 <__panic+0x5e>

00100d32 <__warn>:
}

/* __warn - like panic, but don't */
void
__warn(const char *file, int line, const char *fmt, ...) {
  100d32:	55                   	push   %ebp
  100d33:	89 e5                	mov    %esp,%ebp
  100d35:	83 ec 28             	sub    $0x28,%esp
    va_list ap;
    va_start(ap, fmt);
  100d38:	8d 45 14             	lea    0x14(%ebp),%eax
  100d3b:	89 45 f4             	mov    %eax,-0xc(%ebp)
    cprintf("kernel warning at %s:%d:\n    ", file, line);
  100d3e:	8b 45 0c             	mov    0xc(%ebp),%eax
  100d41:	89 44 24 08          	mov    %eax,0x8(%esp)
  100d45:	8b 45 08             	mov    0x8(%ebp),%eax
  100d48:	89 44 24 04          	mov    %eax,0x4(%esp)
  100d4c:	c7 04 24 24 63 10 00 	movl   $0x106324,(%esp)
  100d53:	e8 e4 f5 ff ff       	call   10033c <cprintf>
    vcprintf(fmt, ap);
  100d58:	8b 45 f4             	mov    -0xc(%ebp),%eax
  100d5b:	89 44 24 04          	mov    %eax,0x4(%esp)
  100d5f:	8b 45 10             	mov    0x10(%ebp),%eax
  100d62:	89 04 24             	mov    %eax,(%esp)
  100d65:	e8 9f f5 ff ff       	call   100309 <vcprintf>
    cprintf("\n");
  100d6a:	c7 04 24 22 63 10 00 	movl   $0x106322,(%esp)
  100d71:	e8 c6 f5 ff ff       	call   10033c <cprintf>
    va_end(ap);
}
  100d76:	c9                   	leave  
  100d77:	c3                   	ret    

00100d78 <is_kernel_panic>:

bool
is_kernel_panic(void) {
  100d78:	55                   	push   %ebp
  100d79:	89 e5                	mov    %esp,%ebp
    return is_panic;
  100d7b:	a1 60 7e 11 00       	mov    0x117e60,%eax
}
  100d80:	5d                   	pop    %ebp
  100d81:	c3                   	ret    

00100d82 <clock_init>:
/* *
 * clock_init - initialize 8253 clock to interrupt 100 times per second,
 * and then enable IRQ_TIMER.
 * */
void
clock_init(void) {
  100d82:	55                   	push   %ebp
  100d83:	89 e5                	mov    %esp,%ebp
  100d85:	83 ec 28             	sub    $0x28,%esp
  100d88:	66 c7 45 f6 43 00    	movw   $0x43,-0xa(%ebp)
  100d8e:	c6 45 f5 34          	movb   $0x34,-0xb(%ebp)
        : "memory", "cc");
}

static inline void
outb(uint16_t port, uint8_t data) {
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
  100d92:	0f b6 45 f5          	movzbl -0xb(%ebp),%eax
  100d96:	0f b7 55 f6          	movzwl -0xa(%ebp),%edx
  100d9a:	ee                   	out    %al,(%dx)
  100d9b:	66 c7 45 f2 40 00    	movw   $0x40,-0xe(%ebp)
  100da1:	c6 45 f1 9c          	movb   $0x9c,-0xf(%ebp)
  100da5:	0f b6 45 f1          	movzbl -0xf(%ebp),%eax
  100da9:	0f b7 55 f2          	movzwl -0xe(%ebp),%edx
  100dad:	ee                   	out    %al,(%dx)
  100dae:	66 c7 45 ee 40 00    	movw   $0x40,-0x12(%ebp)
  100db4:	c6 45 ed 2e          	movb   $0x2e,-0x13(%ebp)
  100db8:	0f b6 45 ed          	movzbl -0x13(%ebp),%eax
  100dbc:	0f b7 55 ee          	movzwl -0x12(%ebp),%edx
  100dc0:	ee                   	out    %al,(%dx)
    outb(TIMER_MODE, TIMER_SEL0 | TIMER_RATEGEN | TIMER_16BIT);
    outb(IO_TIMER1, TIMER_DIV(100) % 256);
    outb(IO_TIMER1, TIMER_DIV(100) / 256);

    // initialize time counter 'ticks' to zero
    ticks = 0;
  100dc1:	c7 05 4c 89 11 00 00 	movl   $0x0,0x11894c
  100dc8:	00 00 00 

    cprintf("++ setup timer interrupts\n");
  100dcb:	c7 04 24 42 63 10 00 	movl   $0x106342,(%esp)
  100dd2:	e8 65 f5 ff ff       	call   10033c <cprintf>
    pic_enable(IRQ_TIMER);
  100dd7:	c7 04 24 00 00 00 00 	movl   $0x0,(%esp)
  100dde:	e8 24 09 00 00       	call   101707 <pic_enable>
}
  100de3:	c9                   	leave  
  100de4:	c3                   	ret    

00100de5 <__intr_save>:
#include <x86.h>
#include <intr.h>
#include <mmu.h>

static inline bool
__intr_save(void) {
  100de5:	55                   	push   %ebp
  100de6:	89 e5                	mov    %esp,%ebp
  100de8:	83 ec 18             	sub    $0x18,%esp
}

static inline uint32_t
read_eflags(void) {
    uint32_t eflags;
    asm volatile ("pushfl; popl %0" : "=r" (eflags));
  100deb:	9c                   	pushf  
  100dec:	58                   	pop    %eax
  100ded:	89 45 f4             	mov    %eax,-0xc(%ebp)
    return eflags;
  100df0:	8b 45 f4             	mov    -0xc(%ebp),%eax
    if (read_eflags() & FL_IF) {
  100df3:	25 00 02 00 00       	and    $0x200,%eax
  100df8:	85 c0                	test   %eax,%eax
  100dfa:	74 0c                	je     100e08 <__intr_save+0x23>
        intr_disable();
  100dfc:	e8 a8 08 00 00       	call   1016a9 <intr_disable>
        return 1;
  100e01:	b8 01 00 00 00       	mov    $0x1,%eax
  100e06:	eb 05                	jmp    100e0d <__intr_save+0x28>
    }
    return 0;
  100e08:	b8 00 00 00 00       	mov    $0x0,%eax
}
  100e0d:	c9                   	leave  
  100e0e:	c3                   	ret    

00100e0f <__intr_restore>:

static inline void
__intr_restore(bool flag) {
  100e0f:	55                   	push   %ebp
  100e10:	89 e5                	mov    %esp,%ebp
  100e12:	83 ec 08             	sub    $0x8,%esp
    if (flag) {
  100e15:	83 7d 08 00          	cmpl   $0x0,0x8(%ebp)
  100e19:	74 05                	je     100e20 <__intr_restore+0x11>
        intr_enable();
  100e1b:	e8 83 08 00 00       	call   1016a3 <intr_enable>
    }
}
  100e20:	c9                   	leave  
  100e21:	c3                   	ret    

00100e22 <delay>:
#include <memlayout.h>
#include <sync.h>

/* stupid I/O delay routine necessitated by historical PC design flaws */
static void
delay(void) {
  100e22:	55                   	push   %ebp
  100e23:	89 e5                	mov    %esp,%ebp
  100e25:	83 ec 10             	sub    $0x10,%esp
  100e28:	66 c7 45 fe 84 00    	movw   $0x84,-0x2(%ebp)
static inline void invlpg(void *addr) __attribute__((always_inline));

static inline uint8_t
inb(uint16_t port) {
    uint8_t data;
    asm volatile ("inb %1, %0" : "=a" (data) : "d" (port) : "memory");
  100e2e:	0f b7 45 fe          	movzwl -0x2(%ebp),%eax
  100e32:	89 c2                	mov    %eax,%edx
  100e34:	ec                   	in     (%dx),%al
  100e35:	88 45 fd             	mov    %al,-0x3(%ebp)
  100e38:	66 c7 45 fa 84 00    	movw   $0x84,-0x6(%ebp)
  100e3e:	0f b7 45 fa          	movzwl -0x6(%ebp),%eax
  100e42:	89 c2                	mov    %eax,%edx
  100e44:	ec                   	in     (%dx),%al
  100e45:	88 45 f9             	mov    %al,-0x7(%ebp)
  100e48:	66 c7 45 f6 84 00    	movw   $0x84,-0xa(%ebp)
  100e4e:	0f b7 45 f6          	movzwl -0xa(%ebp),%eax
  100e52:	89 c2                	mov    %eax,%edx
  100e54:	ec                   	in     (%dx),%al
  100e55:	88 45 f5             	mov    %al,-0xb(%ebp)
  100e58:	66 c7 45 f2 84 00    	movw   $0x84,-0xe(%ebp)
  100e5e:	0f b7 45 f2          	movzwl -0xe(%ebp),%eax
  100e62:	89 c2                	mov    %eax,%edx
  100e64:	ec                   	in     (%dx),%al
  100e65:	88 45 f1             	mov    %al,-0xf(%ebp)
    inb(0x84);
    inb(0x84);
    inb(0x84);
    inb(0x84);
}
  100e68:	c9                   	leave  
  100e69:	c3                   	ret    

00100e6a <cga_init>:
static uint16_t addr_6845;

/* TEXT-mode CGA/VGA display output */

static void
cga_init(void) {
  100e6a:	55                   	push   %ebp
  100e6b:	89 e5                	mov    %esp,%ebp
  100e6d:	83 ec 20             	sub    $0x20,%esp
    volatile uint16_t *cp = (uint16_t *)(CGA_BUF + KERNBASE);
  100e70:	c7 45 fc 00 80 0b c0 	movl   $0xc00b8000,-0x4(%ebp)
    uint16_t was = *cp;
  100e77:	8b 45 fc             	mov    -0x4(%ebp),%eax
  100e7a:	0f b7 00             	movzwl (%eax),%eax
  100e7d:	66 89 45 fa          	mov    %ax,-0x6(%ebp)
    *cp = (uint16_t) 0xA55A;
  100e81:	8b 45 fc             	mov    -0x4(%ebp),%eax
  100e84:	66 c7 00 5a a5       	movw   $0xa55a,(%eax)
    if (*cp != 0xA55A) {
  100e89:	8b 45 fc             	mov    -0x4(%ebp),%eax
  100e8c:	0f b7 00             	movzwl (%eax),%eax
  100e8f:	66 3d 5a a5          	cmp    $0xa55a,%ax
  100e93:	74 12                	je     100ea7 <cga_init+0x3d>
        cp = (uint16_t*)(MONO_BUF + KERNBASE);
  100e95:	c7 45 fc 00 00 0b c0 	movl   $0xc00b0000,-0x4(%ebp)
        addr_6845 = MONO_BASE;
  100e9c:	66 c7 05 86 7e 11 00 	movw   $0x3b4,0x117e86
  100ea3:	b4 03 
  100ea5:	eb 13                	jmp    100eba <cga_init+0x50>
    } else {
        *cp = was;
  100ea7:	8b 45 fc             	mov    -0x4(%ebp),%eax
  100eaa:	0f b7 55 fa          	movzwl -0x6(%ebp),%edx
  100eae:	66 89 10             	mov    %dx,(%eax)
        addr_6845 = CGA_BASE;
  100eb1:	66 c7 05 86 7e 11 00 	movw   $0x3d4,0x117e86
  100eb8:	d4 03 
    }

    // Extract cursor location
    uint32_t pos;
    outb(addr_6845, 14);
  100eba:	0f b7 05 86 7e 11 00 	movzwl 0x117e86,%eax
  100ec1:	0f b7 c0             	movzwl %ax,%eax
  100ec4:	66 89 45 f2          	mov    %ax,-0xe(%ebp)
  100ec8:	c6 45 f1 0e          	movb   $0xe,-0xf(%ebp)
        : "memory", "cc");
}

static inline void
outb(uint16_t port, uint8_t data) {
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
  100ecc:	0f b6 45 f1          	movzbl -0xf(%ebp),%eax
  100ed0:	0f b7 55 f2          	movzwl -0xe(%ebp),%edx
  100ed4:	ee                   	out    %al,(%dx)
    pos = inb(addr_6845 + 1) << 8;
  100ed5:	0f b7 05 86 7e 11 00 	movzwl 0x117e86,%eax
  100edc:	83 c0 01             	add    $0x1,%eax
  100edf:	0f b7 c0             	movzwl %ax,%eax
  100ee2:	66 89 45 ee          	mov    %ax,-0x12(%ebp)
static inline void invlpg(void *addr) __attribute__((always_inline));

static inline uint8_t
inb(uint16_t port) {
    uint8_t data;
    asm volatile ("inb %1, %0" : "=a" (data) : "d" (port) : "memory");
  100ee6:	0f b7 45 ee          	movzwl -0x12(%ebp),%eax
  100eea:	89 c2                	mov    %eax,%edx
  100eec:	ec                   	in     (%dx),%al
  100eed:	88 45 ed             	mov    %al,-0x13(%ebp)
    return data;
  100ef0:	0f b6 45 ed          	movzbl -0x13(%ebp),%eax
  100ef4:	0f b6 c0             	movzbl %al,%eax
  100ef7:	c1 e0 08             	shl    $0x8,%eax
  100efa:	89 45 f4             	mov    %eax,-0xc(%ebp)
    outb(addr_6845, 15);
  100efd:	0f b7 05 86 7e 11 00 	movzwl 0x117e86,%eax
  100f04:	0f b7 c0             	movzwl %ax,%eax
  100f07:	66 89 45 ea          	mov    %ax,-0x16(%ebp)
  100f0b:	c6 45 e9 0f          	movb   $0xf,-0x17(%ebp)
        : "memory", "cc");
}

static inline void
outb(uint16_t port, uint8_t data) {
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
  100f0f:	0f b6 45 e9          	movzbl -0x17(%ebp),%eax
  100f13:	0f b7 55 ea          	movzwl -0x16(%ebp),%edx
  100f17:	ee                   	out    %al,(%dx)
    pos |= inb(addr_6845 + 1);
  100f18:	0f b7 05 86 7e 11 00 	movzwl 0x117e86,%eax
  100f1f:	83 c0 01             	add    $0x1,%eax
  100f22:	0f b7 c0             	movzwl %ax,%eax
  100f25:	66 89 45 e6          	mov    %ax,-0x1a(%ebp)
static inline void invlpg(void *addr) __attribute__((always_inline));

static inline uint8_t
inb(uint16_t port) {
    uint8_t data;
    asm volatile ("inb %1, %0" : "=a" (data) : "d" (port) : "memory");
  100f29:	0f b7 45 e6          	movzwl -0x1a(%ebp),%eax
  100f2d:	89 c2                	mov    %eax,%edx
  100f2f:	ec                   	in     (%dx),%al
  100f30:	88 45 e5             	mov    %al,-0x1b(%ebp)
    return data;
  100f33:	0f b6 45 e5          	movzbl -0x1b(%ebp),%eax
  100f37:	0f b6 c0             	movzbl %al,%eax
  100f3a:	09 45 f4             	or     %eax,-0xc(%ebp)

    crt_buf = (uint16_t*) cp;
  100f3d:	8b 45 fc             	mov    -0x4(%ebp),%eax
  100f40:	a3 80 7e 11 00       	mov    %eax,0x117e80
    crt_pos = pos;
  100f45:	8b 45 f4             	mov    -0xc(%ebp),%eax
  100f48:	66 a3 84 7e 11 00    	mov    %ax,0x117e84
}
  100f4e:	c9                   	leave  
  100f4f:	c3                   	ret    

00100f50 <serial_init>:

static bool serial_exists = 0;

static void
serial_init(void) {
  100f50:	55                   	push   %ebp
  100f51:	89 e5                	mov    %esp,%ebp
  100f53:	83 ec 48             	sub    $0x48,%esp
  100f56:	66 c7 45 f6 fa 03    	movw   $0x3fa,-0xa(%ebp)
  100f5c:	c6 45 f5 00          	movb   $0x0,-0xb(%ebp)
        : "memory", "cc");
}

static inline void
outb(uint16_t port, uint8_t data) {
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
  100f60:	0f b6 45 f5          	movzbl -0xb(%ebp),%eax
  100f64:	0f b7 55 f6          	movzwl -0xa(%ebp),%edx
  100f68:	ee                   	out    %al,(%dx)
  100f69:	66 c7 45 f2 fb 03    	movw   $0x3fb,-0xe(%ebp)
  100f6f:	c6 45 f1 80          	movb   $0x80,-0xf(%ebp)
  100f73:	0f b6 45 f1          	movzbl -0xf(%ebp),%eax
  100f77:	0f b7 55 f2          	movzwl -0xe(%ebp),%edx
  100f7b:	ee                   	out    %al,(%dx)
  100f7c:	66 c7 45 ee f8 03    	movw   $0x3f8,-0x12(%ebp)
  100f82:	c6 45 ed 0c          	movb   $0xc,-0x13(%ebp)
  100f86:	0f b6 45 ed          	movzbl -0x13(%ebp),%eax
  100f8a:	0f b7 55 ee          	movzwl -0x12(%ebp),%edx
  100f8e:	ee                   	out    %al,(%dx)
  100f8f:	66 c7 45 ea f9 03    	movw   $0x3f9,-0x16(%ebp)
  100f95:	c6 45 e9 00          	movb   $0x0,-0x17(%ebp)
  100f99:	0f b6 45 e9          	movzbl -0x17(%ebp),%eax
  100f9d:	0f b7 55 ea          	movzwl -0x16(%ebp),%edx
  100fa1:	ee                   	out    %al,(%dx)
  100fa2:	66 c7 45 e6 fb 03    	movw   $0x3fb,-0x1a(%ebp)
  100fa8:	c6 45 e5 03          	movb   $0x3,-0x1b(%ebp)
  100fac:	0f b6 45 e5          	movzbl -0x1b(%ebp),%eax
  100fb0:	0f b7 55 e6          	movzwl -0x1a(%ebp),%edx
  100fb4:	ee                   	out    %al,(%dx)
  100fb5:	66 c7 45 e2 fc 03    	movw   $0x3fc,-0x1e(%ebp)
  100fbb:	c6 45 e1 00          	movb   $0x0,-0x1f(%ebp)
  100fbf:	0f b6 45 e1          	movzbl -0x1f(%ebp),%eax
  100fc3:	0f b7 55 e2          	movzwl -0x1e(%ebp),%edx
  100fc7:	ee                   	out    %al,(%dx)
  100fc8:	66 c7 45 de f9 03    	movw   $0x3f9,-0x22(%ebp)
  100fce:	c6 45 dd 01          	movb   $0x1,-0x23(%ebp)
  100fd2:	0f b6 45 dd          	movzbl -0x23(%ebp),%eax
  100fd6:	0f b7 55 de          	movzwl -0x22(%ebp),%edx
  100fda:	ee                   	out    %al,(%dx)
  100fdb:	66 c7 45 da fd 03    	movw   $0x3fd,-0x26(%ebp)
static inline void invlpg(void *addr) __attribute__((always_inline));

static inline uint8_t
inb(uint16_t port) {
    uint8_t data;
    asm volatile ("inb %1, %0" : "=a" (data) : "d" (port) : "memory");
  100fe1:	0f b7 45 da          	movzwl -0x26(%ebp),%eax
  100fe5:	89 c2                	mov    %eax,%edx
  100fe7:	ec                   	in     (%dx),%al
  100fe8:	88 45 d9             	mov    %al,-0x27(%ebp)
    return data;
  100feb:	0f b6 45 d9          	movzbl -0x27(%ebp),%eax
    // Enable rcv interrupts
    outb(COM1 + COM_IER, COM_IER_RDI);

    // Clear any preexisting overrun indications and interrupts
    // Serial port doesn't exist if COM_LSR returns 0xFF
    serial_exists = (inb(COM1 + COM_LSR) != 0xFF);
  100fef:	3c ff                	cmp    $0xff,%al
  100ff1:	0f 95 c0             	setne  %al
  100ff4:	0f b6 c0             	movzbl %al,%eax
  100ff7:	a3 88 7e 11 00       	mov    %eax,0x117e88
  100ffc:	66 c7 45 d6 fa 03    	movw   $0x3fa,-0x2a(%ebp)
static inline void invlpg(void *addr) __attribute__((always_inline));

static inline uint8_t
inb(uint16_t port) {
    uint8_t data;
    asm volatile ("inb %1, %0" : "=a" (data) : "d" (port) : "memory");
  101002:	0f b7 45 d6          	movzwl -0x2a(%ebp),%eax
  101006:	89 c2                	mov    %eax,%edx
  101008:	ec                   	in     (%dx),%al
  101009:	88 45 d5             	mov    %al,-0x2b(%ebp)
  10100c:	66 c7 45 d2 f8 03    	movw   $0x3f8,-0x2e(%ebp)
  101012:	0f b7 45 d2          	movzwl -0x2e(%ebp),%eax
  101016:	89 c2                	mov    %eax,%edx
  101018:	ec                   	in     (%dx),%al
  101019:	88 45 d1             	mov    %al,-0x2f(%ebp)
    (void) inb(COM1+COM_IIR);
    (void) inb(COM1+COM_RX);

    if (serial_exists) {
  10101c:	a1 88 7e 11 00       	mov    0x117e88,%eax
  101021:	85 c0                	test   %eax,%eax
  101023:	74 0c                	je     101031 <serial_init+0xe1>
        pic_enable(IRQ_COM1);
  101025:	c7 04 24 04 00 00 00 	movl   $0x4,(%esp)
  10102c:	e8 d6 06 00 00       	call   101707 <pic_enable>
    }
}
  101031:	c9                   	leave  
  101032:	c3                   	ret    

00101033 <lpt_putc_sub>:

static void
lpt_putc_sub(int c) {
  101033:	55                   	push   %ebp
  101034:	89 e5                	mov    %esp,%ebp
  101036:	83 ec 20             	sub    $0x20,%esp
    int i;
    for (i = 0; !(inb(LPTPORT + 1) & 0x80) && i < 12800; i ++) {
  101039:	c7 45 fc 00 00 00 00 	movl   $0x0,-0x4(%ebp)
  101040:	eb 09                	jmp    10104b <lpt_putc_sub+0x18>
        delay();
  101042:	e8 db fd ff ff       	call   100e22 <delay>
}

static void
lpt_putc_sub(int c) {
    int i;
    for (i = 0; !(inb(LPTPORT + 1) & 0x80) && i < 12800; i ++) {
  101047:	83 45 fc 01          	addl   $0x1,-0x4(%ebp)
  10104b:	66 c7 45 fa 79 03    	movw   $0x379,-0x6(%ebp)
  101051:	0f b7 45 fa          	movzwl -0x6(%ebp),%eax
  101055:	89 c2                	mov    %eax,%edx
  101057:	ec                   	in     (%dx),%al
  101058:	88 45 f9             	mov    %al,-0x7(%ebp)
    return data;
  10105b:	0f b6 45 f9          	movzbl -0x7(%ebp),%eax
  10105f:	84 c0                	test   %al,%al
  101061:	78 09                	js     10106c <lpt_putc_sub+0x39>
  101063:	81 7d fc ff 31 00 00 	cmpl   $0x31ff,-0x4(%ebp)
  10106a:	7e d6                	jle    101042 <lpt_putc_sub+0xf>
        delay();
    }
    outb(LPTPORT + 0, c);
  10106c:	8b 45 08             	mov    0x8(%ebp),%eax
  10106f:	0f b6 c0             	movzbl %al,%eax
  101072:	66 c7 45 f6 78 03    	movw   $0x378,-0xa(%ebp)
  101078:	88 45 f5             	mov    %al,-0xb(%ebp)
        : "memory", "cc");
}

static inline void
outb(uint16_t port, uint8_t data) {
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
  10107b:	0f b6 45 f5          	movzbl -0xb(%ebp),%eax
  10107f:	0f b7 55 f6          	movzwl -0xa(%ebp),%edx
  101083:	ee                   	out    %al,(%dx)
  101084:	66 c7 45 f2 7a 03    	movw   $0x37a,-0xe(%ebp)
  10108a:	c6 45 f1 0d          	movb   $0xd,-0xf(%ebp)
  10108e:	0f b6 45 f1          	movzbl -0xf(%ebp),%eax
  101092:	0f b7 55 f2          	movzwl -0xe(%ebp),%edx
  101096:	ee                   	out    %al,(%dx)
  101097:	66 c7 45 ee 7a 03    	movw   $0x37a,-0x12(%ebp)
  10109d:	c6 45 ed 08          	movb   $0x8,-0x13(%ebp)
  1010a1:	0f b6 45 ed          	movzbl -0x13(%ebp),%eax
  1010a5:	0f b7 55 ee          	movzwl -0x12(%ebp),%edx
  1010a9:	ee                   	out    %al,(%dx)
    outb(LPTPORT + 2, 0x08 | 0x04 | 0x01);
    outb(LPTPORT + 2, 0x08);
}
  1010aa:	c9                   	leave  
  1010ab:	c3                   	ret    

001010ac <lpt_putc>:

/* lpt_putc - copy console output to parallel port */
static void
lpt_putc(int c) {
  1010ac:	55                   	push   %ebp
  1010ad:	89 e5                	mov    %esp,%ebp
  1010af:	83 ec 04             	sub    $0x4,%esp
    if (c != '\b') {
  1010b2:	83 7d 08 08          	cmpl   $0x8,0x8(%ebp)
  1010b6:	74 0d                	je     1010c5 <lpt_putc+0x19>
        lpt_putc_sub(c);
  1010b8:	8b 45 08             	mov    0x8(%ebp),%eax
  1010bb:	89 04 24             	mov    %eax,(%esp)
  1010be:	e8 70 ff ff ff       	call   101033 <lpt_putc_sub>
  1010c3:	eb 24                	jmp    1010e9 <lpt_putc+0x3d>
    }
    else {
        lpt_putc_sub('\b');
  1010c5:	c7 04 24 08 00 00 00 	movl   $0x8,(%esp)
  1010cc:	e8 62 ff ff ff       	call   101033 <lpt_putc_sub>
        lpt_putc_sub(' ');
  1010d1:	c7 04 24 20 00 00 00 	movl   $0x20,(%esp)
  1010d8:	e8 56 ff ff ff       	call   101033 <lpt_putc_sub>
        lpt_putc_sub('\b');
  1010dd:	c7 04 24 08 00 00 00 	movl   $0x8,(%esp)
  1010e4:	e8 4a ff ff ff       	call   101033 <lpt_putc_sub>
    }
}
  1010e9:	c9                   	leave  
  1010ea:	c3                   	ret    

001010eb <cga_putc>:

/* cga_putc - print character to console */
static void
cga_putc(int c) {
  1010eb:	55                   	push   %ebp
  1010ec:	89 e5                	mov    %esp,%ebp
  1010ee:	53                   	push   %ebx
  1010ef:	83 ec 34             	sub    $0x34,%esp
    // set black on white
    if (!(c & ~0xFF)) {
  1010f2:	8b 45 08             	mov    0x8(%ebp),%eax
  1010f5:	b0 00                	mov    $0x0,%al
  1010f7:	85 c0                	test   %eax,%eax
  1010f9:	75 07                	jne    101102 <cga_putc+0x17>
        c |= 0x0700;
  1010fb:	81 4d 08 00 07 00 00 	orl    $0x700,0x8(%ebp)
    }

    switch (c & 0xff) {
  101102:	8b 45 08             	mov    0x8(%ebp),%eax
  101105:	0f b6 c0             	movzbl %al,%eax
  101108:	83 f8 0a             	cmp    $0xa,%eax
  10110b:	74 4c                	je     101159 <cga_putc+0x6e>
  10110d:	83 f8 0d             	cmp    $0xd,%eax
  101110:	74 57                	je     101169 <cga_putc+0x7e>
  101112:	83 f8 08             	cmp    $0x8,%eax
  101115:	0f 85 88 00 00 00    	jne    1011a3 <cga_putc+0xb8>
    case '\b':
        if (crt_pos > 0) {
  10111b:	0f b7 05 84 7e 11 00 	movzwl 0x117e84,%eax
  101122:	66 85 c0             	test   %ax,%ax
  101125:	74 30                	je     101157 <cga_putc+0x6c>
            crt_pos --;
  101127:	0f b7 05 84 7e 11 00 	movzwl 0x117e84,%eax
  10112e:	83 e8 01             	sub    $0x1,%eax
  101131:	66 a3 84 7e 11 00    	mov    %ax,0x117e84
            crt_buf[crt_pos] = (c & ~0xff) | ' ';
  101137:	a1 80 7e 11 00       	mov    0x117e80,%eax
  10113c:	0f b7 15 84 7e 11 00 	movzwl 0x117e84,%edx
  101143:	0f b7 d2             	movzwl %dx,%edx
  101146:	01 d2                	add    %edx,%edx
  101148:	01 c2                	add    %eax,%edx
  10114a:	8b 45 08             	mov    0x8(%ebp),%eax
  10114d:	b0 00                	mov    $0x0,%al
  10114f:	83 c8 20             	or     $0x20,%eax
  101152:	66 89 02             	mov    %ax,(%edx)
        }
        break;
  101155:	eb 72                	jmp    1011c9 <cga_putc+0xde>
  101157:	eb 70                	jmp    1011c9 <cga_putc+0xde>
    case '\n':
        crt_pos += CRT_COLS;
  101159:	0f b7 05 84 7e 11 00 	movzwl 0x117e84,%eax
  101160:	83 c0 50             	add    $0x50,%eax
  101163:	66 a3 84 7e 11 00    	mov    %ax,0x117e84
    case '\r':
        crt_pos -= (crt_pos % CRT_COLS);
  101169:	0f b7 1d 84 7e 11 00 	movzwl 0x117e84,%ebx
  101170:	0f b7 0d 84 7e 11 00 	movzwl 0x117e84,%ecx
  101177:	0f b7 c1             	movzwl %cx,%eax
  10117a:	69 c0 cd cc 00 00    	imul   $0xcccd,%eax,%eax
  101180:	c1 e8 10             	shr    $0x10,%eax
  101183:	89 c2                	mov    %eax,%edx
  101185:	66 c1 ea 06          	shr    $0x6,%dx
  101189:	89 d0                	mov    %edx,%eax
  10118b:	c1 e0 02             	shl    $0x2,%eax
  10118e:	01 d0                	add    %edx,%eax
  101190:	c1 e0 04             	shl    $0x4,%eax
  101193:	29 c1                	sub    %eax,%ecx
  101195:	89 ca                	mov    %ecx,%edx
  101197:	89 d8                	mov    %ebx,%eax
  101199:	29 d0                	sub    %edx,%eax
  10119b:	66 a3 84 7e 11 00    	mov    %ax,0x117e84
        break;
  1011a1:	eb 26                	jmp    1011c9 <cga_putc+0xde>
    default:
        crt_buf[crt_pos ++] = c;     // write the character
  1011a3:	8b 0d 80 7e 11 00    	mov    0x117e80,%ecx
  1011a9:	0f b7 05 84 7e 11 00 	movzwl 0x117e84,%eax
  1011b0:	8d 50 01             	lea    0x1(%eax),%edx
  1011b3:	66 89 15 84 7e 11 00 	mov    %dx,0x117e84
  1011ba:	0f b7 c0             	movzwl %ax,%eax
  1011bd:	01 c0                	add    %eax,%eax
  1011bf:	8d 14 01             	lea    (%ecx,%eax,1),%edx
  1011c2:	8b 45 08             	mov    0x8(%ebp),%eax
  1011c5:	66 89 02             	mov    %ax,(%edx)
        break;
  1011c8:	90                   	nop
    }

    // What is the purpose of this?
    if (crt_pos >= CRT_SIZE) {
  1011c9:	0f b7 05 84 7e 11 00 	movzwl 0x117e84,%eax
  1011d0:	66 3d cf 07          	cmp    $0x7cf,%ax
  1011d4:	76 5b                	jbe    101231 <cga_putc+0x146>
        int i;
        memmove(crt_buf, crt_buf + CRT_COLS, (CRT_SIZE - CRT_COLS) * sizeof(uint16_t));
  1011d6:	a1 80 7e 11 00       	mov    0x117e80,%eax
  1011db:	8d 90 a0 00 00 00    	lea    0xa0(%eax),%edx
  1011e1:	a1 80 7e 11 00       	mov    0x117e80,%eax
  1011e6:	c7 44 24 08 00 0f 00 	movl   $0xf00,0x8(%esp)
  1011ed:	00 
  1011ee:	89 54 24 04          	mov    %edx,0x4(%esp)
  1011f2:	89 04 24             	mov    %eax,(%esp)
  1011f5:	e8 ee 4c 00 00       	call   105ee8 <memmove>
        for (i = CRT_SIZE - CRT_COLS; i < CRT_SIZE; i ++) {
  1011fa:	c7 45 f4 80 07 00 00 	movl   $0x780,-0xc(%ebp)
  101201:	eb 15                	jmp    101218 <cga_putc+0x12d>
            crt_buf[i] = 0x0700 | ' ';
  101203:	a1 80 7e 11 00       	mov    0x117e80,%eax
  101208:	8b 55 f4             	mov    -0xc(%ebp),%edx
  10120b:	01 d2                	add    %edx,%edx
  10120d:	01 d0                	add    %edx,%eax
  10120f:	66 c7 00 20 07       	movw   $0x720,(%eax)

    // What is the purpose of this?
    if (crt_pos >= CRT_SIZE) {
        int i;
        memmove(crt_buf, crt_buf + CRT_COLS, (CRT_SIZE - CRT_COLS) * sizeof(uint16_t));
        for (i = CRT_SIZE - CRT_COLS; i < CRT_SIZE; i ++) {
  101214:	83 45 f4 01          	addl   $0x1,-0xc(%ebp)
  101218:	81 7d f4 cf 07 00 00 	cmpl   $0x7cf,-0xc(%ebp)
  10121f:	7e e2                	jle    101203 <cga_putc+0x118>
            crt_buf[i] = 0x0700 | ' ';
        }
        crt_pos -= CRT_COLS;
  101221:	0f b7 05 84 7e 11 00 	movzwl 0x117e84,%eax
  101228:	83 e8 50             	sub    $0x50,%eax
  10122b:	66 a3 84 7e 11 00    	mov    %ax,0x117e84
    }

    // move that little blinky thing
    outb(addr_6845, 14);
  101231:	0f b7 05 86 7e 11 00 	movzwl 0x117e86,%eax
  101238:	0f b7 c0             	movzwl %ax,%eax
  10123b:	66 89 45 f2          	mov    %ax,-0xe(%ebp)
  10123f:	c6 45 f1 0e          	movb   $0xe,-0xf(%ebp)
  101243:	0f b6 45 f1          	movzbl -0xf(%ebp),%eax
  101247:	0f b7 55 f2          	movzwl -0xe(%ebp),%edx
  10124b:	ee                   	out    %al,(%dx)
    outb(addr_6845 + 1, crt_pos >> 8);
  10124c:	0f b7 05 84 7e 11 00 	movzwl 0x117e84,%eax
  101253:	66 c1 e8 08          	shr    $0x8,%ax
  101257:	0f b6 c0             	movzbl %al,%eax
  10125a:	0f b7 15 86 7e 11 00 	movzwl 0x117e86,%edx
  101261:	83 c2 01             	add    $0x1,%edx
  101264:	0f b7 d2             	movzwl %dx,%edx
  101267:	66 89 55 ee          	mov    %dx,-0x12(%ebp)
  10126b:	88 45 ed             	mov    %al,-0x13(%ebp)
  10126e:	0f b6 45 ed          	movzbl -0x13(%ebp),%eax
  101272:	0f b7 55 ee          	movzwl -0x12(%ebp),%edx
  101276:	ee                   	out    %al,(%dx)
    outb(addr_6845, 15);
  101277:	0f b7 05 86 7e 11 00 	movzwl 0x117e86,%eax
  10127e:	0f b7 c0             	movzwl %ax,%eax
  101281:	66 89 45 ea          	mov    %ax,-0x16(%ebp)
  101285:	c6 45 e9 0f          	movb   $0xf,-0x17(%ebp)
  101289:	0f b6 45 e9          	movzbl -0x17(%ebp),%eax
  10128d:	0f b7 55 ea          	movzwl -0x16(%ebp),%edx
  101291:	ee                   	out    %al,(%dx)
    outb(addr_6845 + 1, crt_pos);
  101292:	0f b7 05 84 7e 11 00 	movzwl 0x117e84,%eax
  101299:	0f b6 c0             	movzbl %al,%eax
  10129c:	0f b7 15 86 7e 11 00 	movzwl 0x117e86,%edx
  1012a3:	83 c2 01             	add    $0x1,%edx
  1012a6:	0f b7 d2             	movzwl %dx,%edx
  1012a9:	66 89 55 e6          	mov    %dx,-0x1a(%ebp)
  1012ad:	88 45 e5             	mov    %al,-0x1b(%ebp)
  1012b0:	0f b6 45 e5          	movzbl -0x1b(%ebp),%eax
  1012b4:	0f b7 55 e6          	movzwl -0x1a(%ebp),%edx
  1012b8:	ee                   	out    %al,(%dx)
}
  1012b9:	83 c4 34             	add    $0x34,%esp
  1012bc:	5b                   	pop    %ebx
  1012bd:	5d                   	pop    %ebp
  1012be:	c3                   	ret    

001012bf <serial_putc_sub>:

static void
serial_putc_sub(int c) {
  1012bf:	55                   	push   %ebp
  1012c0:	89 e5                	mov    %esp,%ebp
  1012c2:	83 ec 10             	sub    $0x10,%esp
    int i;
    for (i = 0; !(inb(COM1 + COM_LSR) & COM_LSR_TXRDY) && i < 12800; i ++) {
  1012c5:	c7 45 fc 00 00 00 00 	movl   $0x0,-0x4(%ebp)
  1012cc:	eb 09                	jmp    1012d7 <serial_putc_sub+0x18>
        delay();
  1012ce:	e8 4f fb ff ff       	call   100e22 <delay>
}

static void
serial_putc_sub(int c) {
    int i;
    for (i = 0; !(inb(COM1 + COM_LSR) & COM_LSR_TXRDY) && i < 12800; i ++) {
  1012d3:	83 45 fc 01          	addl   $0x1,-0x4(%ebp)
  1012d7:	66 c7 45 fa fd 03    	movw   $0x3fd,-0x6(%ebp)
static inline void invlpg(void *addr) __attribute__((always_inline));

static inline uint8_t
inb(uint16_t port) {
    uint8_t data;
    asm volatile ("inb %1, %0" : "=a" (data) : "d" (port) : "memory");
  1012dd:	0f b7 45 fa          	movzwl -0x6(%ebp),%eax
  1012e1:	89 c2                	mov    %eax,%edx
  1012e3:	ec                   	in     (%dx),%al
  1012e4:	88 45 f9             	mov    %al,-0x7(%ebp)
    return data;
  1012e7:	0f b6 45 f9          	movzbl -0x7(%ebp),%eax
  1012eb:	0f b6 c0             	movzbl %al,%eax
  1012ee:	83 e0 20             	and    $0x20,%eax
  1012f1:	85 c0                	test   %eax,%eax
  1012f3:	75 09                	jne    1012fe <serial_putc_sub+0x3f>
  1012f5:	81 7d fc ff 31 00 00 	cmpl   $0x31ff,-0x4(%ebp)
  1012fc:	7e d0                	jle    1012ce <serial_putc_sub+0xf>
        delay();
    }
    outb(COM1 + COM_TX, c);
  1012fe:	8b 45 08             	mov    0x8(%ebp),%eax
  101301:	0f b6 c0             	movzbl %al,%eax
  101304:	66 c7 45 f6 f8 03    	movw   $0x3f8,-0xa(%ebp)
  10130a:	88 45 f5             	mov    %al,-0xb(%ebp)
        : "memory", "cc");
}

static inline void
outb(uint16_t port, uint8_t data) {
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
  10130d:	0f b6 45 f5          	movzbl -0xb(%ebp),%eax
  101311:	0f b7 55 f6          	movzwl -0xa(%ebp),%edx
  101315:	ee                   	out    %al,(%dx)
}
  101316:	c9                   	leave  
  101317:	c3                   	ret    

00101318 <serial_putc>:

/* serial_putc - print character to serial port */
static void
serial_putc(int c) {
  101318:	55                   	push   %ebp
  101319:	89 e5                	mov    %esp,%ebp
  10131b:	83 ec 04             	sub    $0x4,%esp
    if (c != '\b') {
  10131e:	83 7d 08 08          	cmpl   $0x8,0x8(%ebp)
  101322:	74 0d                	je     101331 <serial_putc+0x19>
        serial_putc_sub(c);
  101324:	8b 45 08             	mov    0x8(%ebp),%eax
  101327:	89 04 24             	mov    %eax,(%esp)
  10132a:	e8 90 ff ff ff       	call   1012bf <serial_putc_sub>
  10132f:	eb 24                	jmp    101355 <serial_putc+0x3d>
    }
    else {
        serial_putc_sub('\b');
  101331:	c7 04 24 08 00 00 00 	movl   $0x8,(%esp)
  101338:	e8 82 ff ff ff       	call   1012bf <serial_putc_sub>
        serial_putc_sub(' ');
  10133d:	c7 04 24 20 00 00 00 	movl   $0x20,(%esp)
  101344:	e8 76 ff ff ff       	call   1012bf <serial_putc_sub>
        serial_putc_sub('\b');
  101349:	c7 04 24 08 00 00 00 	movl   $0x8,(%esp)
  101350:	e8 6a ff ff ff       	call   1012bf <serial_putc_sub>
    }
}
  101355:	c9                   	leave  
  101356:	c3                   	ret    

00101357 <cons_intr>:
/* *
 * cons_intr - called by device interrupt routines to feed input
 * characters into the circular console input buffer.
 * */
static void
cons_intr(int (*proc)(void)) {
  101357:	55                   	push   %ebp
  101358:	89 e5                	mov    %esp,%ebp
  10135a:	83 ec 18             	sub    $0x18,%esp
    int c;
    while ((c = (*proc)()) != -1) {
  10135d:	eb 33                	jmp    101392 <cons_intr+0x3b>
        if (c != 0) {
  10135f:	83 7d f4 00          	cmpl   $0x0,-0xc(%ebp)
  101363:	74 2d                	je     101392 <cons_intr+0x3b>
            cons.buf[cons.wpos ++] = c;
  101365:	a1 a4 80 11 00       	mov    0x1180a4,%eax
  10136a:	8d 50 01             	lea    0x1(%eax),%edx
  10136d:	89 15 a4 80 11 00    	mov    %edx,0x1180a4
  101373:	8b 55 f4             	mov    -0xc(%ebp),%edx
  101376:	88 90 a0 7e 11 00    	mov    %dl,0x117ea0(%eax)
            if (cons.wpos == CONSBUFSIZE) {
  10137c:	a1 a4 80 11 00       	mov    0x1180a4,%eax
  101381:	3d 00 02 00 00       	cmp    $0x200,%eax
  101386:	75 0a                	jne    101392 <cons_intr+0x3b>
                cons.wpos = 0;
  101388:	c7 05 a4 80 11 00 00 	movl   $0x0,0x1180a4
  10138f:	00 00 00 
 * characters into the circular console input buffer.
 * */
static void
cons_intr(int (*proc)(void)) {
    int c;
    while ((c = (*proc)()) != -1) {
  101392:	8b 45 08             	mov    0x8(%ebp),%eax
  101395:	ff d0                	call   *%eax
  101397:	89 45 f4             	mov    %eax,-0xc(%ebp)
  10139a:	83 7d f4 ff          	cmpl   $0xffffffff,-0xc(%ebp)
  10139e:	75 bf                	jne    10135f <cons_intr+0x8>
            if (cons.wpos == CONSBUFSIZE) {
                cons.wpos = 0;
            }
        }
    }
}
  1013a0:	c9                   	leave  
  1013a1:	c3                   	ret    

001013a2 <serial_proc_data>:

/* serial_proc_data - get data from serial port */
static int
serial_proc_data(void) {
  1013a2:	55                   	push   %ebp
  1013a3:	89 e5                	mov    %esp,%ebp
  1013a5:	83 ec 10             	sub    $0x10,%esp
  1013a8:	66 c7 45 fa fd 03    	movw   $0x3fd,-0x6(%ebp)
static inline void invlpg(void *addr) __attribute__((always_inline));

static inline uint8_t
inb(uint16_t port) {
    uint8_t data;
    asm volatile ("inb %1, %0" : "=a" (data) : "d" (port) : "memory");
  1013ae:	0f b7 45 fa          	movzwl -0x6(%ebp),%eax
  1013b2:	89 c2                	mov    %eax,%edx
  1013b4:	ec                   	in     (%dx),%al
  1013b5:	88 45 f9             	mov    %al,-0x7(%ebp)
    return data;
  1013b8:	0f b6 45 f9          	movzbl -0x7(%ebp),%eax
    if (!(inb(COM1 + COM_LSR) & COM_LSR_DATA)) {
  1013bc:	0f b6 c0             	movzbl %al,%eax
  1013bf:	83 e0 01             	and    $0x1,%eax
  1013c2:	85 c0                	test   %eax,%eax
  1013c4:	75 07                	jne    1013cd <serial_proc_data+0x2b>
        return -1;
  1013c6:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
  1013cb:	eb 2a                	jmp    1013f7 <serial_proc_data+0x55>
  1013cd:	66 c7 45 f6 f8 03    	movw   $0x3f8,-0xa(%ebp)
static inline void invlpg(void *addr) __attribute__((always_inline));

static inline uint8_t
inb(uint16_t port) {
    uint8_t data;
    asm volatile ("inb %1, %0" : "=a" (data) : "d" (port) : "memory");
  1013d3:	0f b7 45 f6          	movzwl -0xa(%ebp),%eax
  1013d7:	89 c2                	mov    %eax,%edx
  1013d9:	ec                   	in     (%dx),%al
  1013da:	88 45 f5             	mov    %al,-0xb(%ebp)
    return data;
  1013dd:	0f b6 45 f5          	movzbl -0xb(%ebp),%eax
    }
    int c = inb(COM1 + COM_RX);
  1013e1:	0f b6 c0             	movzbl %al,%eax
  1013e4:	89 45 fc             	mov    %eax,-0x4(%ebp)
    if (c == 127) {
  1013e7:	83 7d fc 7f          	cmpl   $0x7f,-0x4(%ebp)
  1013eb:	75 07                	jne    1013f4 <serial_proc_data+0x52>
        c = '\b';
  1013ed:	c7 45 fc 08 00 00 00 	movl   $0x8,-0x4(%ebp)
    }
    return c;
  1013f4:	8b 45 fc             	mov    -0x4(%ebp),%eax
}
  1013f7:	c9                   	leave  
  1013f8:	c3                   	ret    

001013f9 <serial_intr>:

/* serial_intr - try to feed input characters from serial port */
void
serial_intr(void) {
  1013f9:	55                   	push   %ebp
  1013fa:	89 e5                	mov    %esp,%ebp
  1013fc:	83 ec 18             	sub    $0x18,%esp
    if (serial_exists) {
  1013ff:	a1 88 7e 11 00       	mov    0x117e88,%eax
  101404:	85 c0                	test   %eax,%eax
  101406:	74 0c                	je     101414 <serial_intr+0x1b>
        cons_intr(serial_proc_data);
  101408:	c7 04 24 a2 13 10 00 	movl   $0x1013a2,(%esp)
  10140f:	e8 43 ff ff ff       	call   101357 <cons_intr>
    }
}
  101414:	c9                   	leave  
  101415:	c3                   	ret    

00101416 <kbd_proc_data>:
 *
 * The kbd_proc_data() function gets data from the keyboard.
 * If we finish a character, return it, else 0. And return -1 if no data.
 * */
static int
kbd_proc_data(void) {
  101416:	55                   	push   %ebp
  101417:	89 e5                	mov    %esp,%ebp
  101419:	83 ec 38             	sub    $0x38,%esp
  10141c:	66 c7 45 f0 64 00    	movw   $0x64,-0x10(%ebp)
static inline void invlpg(void *addr) __attribute__((always_inline));

static inline uint8_t
inb(uint16_t port) {
    uint8_t data;
    asm volatile ("inb %1, %0" : "=a" (data) : "d" (port) : "memory");
  101422:	0f b7 45 f0          	movzwl -0x10(%ebp),%eax
  101426:	89 c2                	mov    %eax,%edx
  101428:	ec                   	in     (%dx),%al
  101429:	88 45 ef             	mov    %al,-0x11(%ebp)
    return data;
  10142c:	0f b6 45 ef          	movzbl -0x11(%ebp),%eax
    int c;
    uint8_t data;
    static uint32_t shift;

    if ((inb(KBSTATP) & KBS_DIB) == 0) {
  101430:	0f b6 c0             	movzbl %al,%eax
  101433:	83 e0 01             	and    $0x1,%eax
  101436:	85 c0                	test   %eax,%eax
  101438:	75 0a                	jne    101444 <kbd_proc_data+0x2e>
        return -1;
  10143a:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
  10143f:	e9 59 01 00 00       	jmp    10159d <kbd_proc_data+0x187>
  101444:	66 c7 45 ec 60 00    	movw   $0x60,-0x14(%ebp)
static inline void invlpg(void *addr) __attribute__((always_inline));

static inline uint8_t
inb(uint16_t port) {
    uint8_t data;
    asm volatile ("inb %1, %0" : "=a" (data) : "d" (port) : "memory");
  10144a:	0f b7 45 ec          	movzwl -0x14(%ebp),%eax
  10144e:	89 c2                	mov    %eax,%edx
  101450:	ec                   	in     (%dx),%al
  101451:	88 45 eb             	mov    %al,-0x15(%ebp)
    return data;
  101454:	0f b6 45 eb          	movzbl -0x15(%ebp),%eax
    }

    data = inb(KBDATAP);
  101458:	88 45 f3             	mov    %al,-0xd(%ebp)

    if (data == 0xE0) {
  10145b:	80 7d f3 e0          	cmpb   $0xe0,-0xd(%ebp)
  10145f:	75 17                	jne    101478 <kbd_proc_data+0x62>
        // E0 escape character
        shift |= E0ESC;
  101461:	a1 a8 80 11 00       	mov    0x1180a8,%eax
  101466:	83 c8 40             	or     $0x40,%eax
  101469:	a3 a8 80 11 00       	mov    %eax,0x1180a8
        return 0;
  10146e:	b8 00 00 00 00       	mov    $0x0,%eax
  101473:	e9 25 01 00 00       	jmp    10159d <kbd_proc_data+0x187>
    } else if (data & 0x80) {
  101478:	0f b6 45 f3          	movzbl -0xd(%ebp),%eax
  10147c:	84 c0                	test   %al,%al
  10147e:	79 47                	jns    1014c7 <kbd_proc_data+0xb1>
        // Key released
        data = (shift & E0ESC ? data : data & 0x7F);
  101480:	a1 a8 80 11 00       	mov    0x1180a8,%eax
  101485:	83 e0 40             	and    $0x40,%eax
  101488:	85 c0                	test   %eax,%eax
  10148a:	75 09                	jne    101495 <kbd_proc_data+0x7f>
  10148c:	0f b6 45 f3          	movzbl -0xd(%ebp),%eax
  101490:	83 e0 7f             	and    $0x7f,%eax
  101493:	eb 04                	jmp    101499 <kbd_proc_data+0x83>
  101495:	0f b6 45 f3          	movzbl -0xd(%ebp),%eax
  101499:	88 45 f3             	mov    %al,-0xd(%ebp)
        shift &= ~(shiftcode[data] | E0ESC);
  10149c:	0f b6 45 f3          	movzbl -0xd(%ebp),%eax
  1014a0:	0f b6 80 60 70 11 00 	movzbl 0x117060(%eax),%eax
  1014a7:	83 c8 40             	or     $0x40,%eax
  1014aa:	0f b6 c0             	movzbl %al,%eax
  1014ad:	f7 d0                	not    %eax
  1014af:	89 c2                	mov    %eax,%edx
  1014b1:	a1 a8 80 11 00       	mov    0x1180a8,%eax
  1014b6:	21 d0                	and    %edx,%eax
  1014b8:	a3 a8 80 11 00       	mov    %eax,0x1180a8
        return 0;
  1014bd:	b8 00 00 00 00       	mov    $0x0,%eax
  1014c2:	e9 d6 00 00 00       	jmp    10159d <kbd_proc_data+0x187>
    } else if (shift & E0ESC) {
  1014c7:	a1 a8 80 11 00       	mov    0x1180a8,%eax
  1014cc:	83 e0 40             	and    $0x40,%eax
  1014cf:	85 c0                	test   %eax,%eax
  1014d1:	74 11                	je     1014e4 <kbd_proc_data+0xce>
        // Last character was an E0 escape; or with 0x80
        data |= 0x80;
  1014d3:	80 4d f3 80          	orb    $0x80,-0xd(%ebp)
        shift &= ~E0ESC;
  1014d7:	a1 a8 80 11 00       	mov    0x1180a8,%eax
  1014dc:	83 e0 bf             	and    $0xffffffbf,%eax
  1014df:	a3 a8 80 11 00       	mov    %eax,0x1180a8
    }

    shift |= shiftcode[data];
  1014e4:	0f b6 45 f3          	movzbl -0xd(%ebp),%eax
  1014e8:	0f b6 80 60 70 11 00 	movzbl 0x117060(%eax),%eax
  1014ef:	0f b6 d0             	movzbl %al,%edx
  1014f2:	a1 a8 80 11 00       	mov    0x1180a8,%eax
  1014f7:	09 d0                	or     %edx,%eax
  1014f9:	a3 a8 80 11 00       	mov    %eax,0x1180a8
    shift ^= togglecode[data];
  1014fe:	0f b6 45 f3          	movzbl -0xd(%ebp),%eax
  101502:	0f b6 80 60 71 11 00 	movzbl 0x117160(%eax),%eax
  101509:	0f b6 d0             	movzbl %al,%edx
  10150c:	a1 a8 80 11 00       	mov    0x1180a8,%eax
  101511:	31 d0                	xor    %edx,%eax
  101513:	a3 a8 80 11 00       	mov    %eax,0x1180a8

    c = charcode[shift & (CTL | SHIFT)][data];
  101518:	a1 a8 80 11 00       	mov    0x1180a8,%eax
  10151d:	83 e0 03             	and    $0x3,%eax
  101520:	8b 14 85 60 75 11 00 	mov    0x117560(,%eax,4),%edx
  101527:	0f b6 45 f3          	movzbl -0xd(%ebp),%eax
  10152b:	01 d0                	add    %edx,%eax
  10152d:	0f b6 00             	movzbl (%eax),%eax
  101530:	0f b6 c0             	movzbl %al,%eax
  101533:	89 45 f4             	mov    %eax,-0xc(%ebp)
    if (shift & CAPSLOCK) {
  101536:	a1 a8 80 11 00       	mov    0x1180a8,%eax
  10153b:	83 e0 08             	and    $0x8,%eax
  10153e:	85 c0                	test   %eax,%eax
  101540:	74 22                	je     101564 <kbd_proc_data+0x14e>
        if ('a' <= c && c <= 'z')
  101542:	83 7d f4 60          	cmpl   $0x60,-0xc(%ebp)
  101546:	7e 0c                	jle    101554 <kbd_proc_data+0x13e>
  101548:	83 7d f4 7a          	cmpl   $0x7a,-0xc(%ebp)
  10154c:	7f 06                	jg     101554 <kbd_proc_data+0x13e>
            c += 'A' - 'a';
  10154e:	83 6d f4 20          	subl   $0x20,-0xc(%ebp)
  101552:	eb 10                	jmp    101564 <kbd_proc_data+0x14e>
        else if ('A' <= c && c <= 'Z')
  101554:	83 7d f4 40          	cmpl   $0x40,-0xc(%ebp)
  101558:	7e 0a                	jle    101564 <kbd_proc_data+0x14e>
  10155a:	83 7d f4 5a          	cmpl   $0x5a,-0xc(%ebp)
  10155e:	7f 04                	jg     101564 <kbd_proc_data+0x14e>
            c += 'a' - 'A';
  101560:	83 45 f4 20          	addl   $0x20,-0xc(%ebp)
    }

    // Process special keys
    // Ctrl-Alt-Del: reboot
    if (!(~shift & (CTL | ALT)) && c == KEY_DEL) {
  101564:	a1 a8 80 11 00       	mov    0x1180a8,%eax
  101569:	f7 d0                	not    %eax
  10156b:	83 e0 06             	and    $0x6,%eax
  10156e:	85 c0                	test   %eax,%eax
  101570:	75 28                	jne    10159a <kbd_proc_data+0x184>
  101572:	81 7d f4 e9 00 00 00 	cmpl   $0xe9,-0xc(%ebp)
  101579:	75 1f                	jne    10159a <kbd_proc_data+0x184>
        cprintf("Rebooting!\n");
  10157b:	c7 04 24 5d 63 10 00 	movl   $0x10635d,(%esp)
  101582:	e8 b5 ed ff ff       	call   10033c <cprintf>
  101587:	66 c7 45 e8 92 00    	movw   $0x92,-0x18(%ebp)
  10158d:	c6 45 e7 03          	movb   $0x3,-0x19(%ebp)
        : "memory", "cc");
}

static inline void
outb(uint16_t port, uint8_t data) {
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
  101591:	0f b6 45 e7          	movzbl -0x19(%ebp),%eax
  101595:	0f b7 55 e8          	movzwl -0x18(%ebp),%edx
  101599:	ee                   	out    %al,(%dx)
        outb(0x92, 0x3); // courtesy of Chris Frost
    }
    return c;
  10159a:	8b 45 f4             	mov    -0xc(%ebp),%eax
}
  10159d:	c9                   	leave  
  10159e:	c3                   	ret    

0010159f <kbd_intr>:

/* kbd_intr - try to feed input characters from keyboard */
static void
kbd_intr(void) {
  10159f:	55                   	push   %ebp
  1015a0:	89 e5                	mov    %esp,%ebp
  1015a2:	83 ec 18             	sub    $0x18,%esp
    cons_intr(kbd_proc_data);
  1015a5:	c7 04 24 16 14 10 00 	movl   $0x101416,(%esp)
  1015ac:	e8 a6 fd ff ff       	call   101357 <cons_intr>
}
  1015b1:	c9                   	leave  
  1015b2:	c3                   	ret    

001015b3 <kbd_init>:

static void
kbd_init(void) {
  1015b3:	55                   	push   %ebp
  1015b4:	89 e5                	mov    %esp,%ebp
  1015b6:	83 ec 18             	sub    $0x18,%esp
    // drain the kbd buffer
    kbd_intr();
  1015b9:	e8 e1 ff ff ff       	call   10159f <kbd_intr>
    pic_enable(IRQ_KBD);
  1015be:	c7 04 24 01 00 00 00 	movl   $0x1,(%esp)
  1015c5:	e8 3d 01 00 00       	call   101707 <pic_enable>
}
  1015ca:	c9                   	leave  
  1015cb:	c3                   	ret    

001015cc <cons_init>:

/* cons_init - initializes the console devices */
void
cons_init(void) {
  1015cc:	55                   	push   %ebp
  1015cd:	89 e5                	mov    %esp,%ebp
  1015cf:	83 ec 18             	sub    $0x18,%esp
    cga_init();
  1015d2:	e8 93 f8 ff ff       	call   100e6a <cga_init>
    serial_init();
  1015d7:	e8 74 f9 ff ff       	call   100f50 <serial_init>
    kbd_init();
  1015dc:	e8 d2 ff ff ff       	call   1015b3 <kbd_init>
    if (!serial_exists) {
  1015e1:	a1 88 7e 11 00       	mov    0x117e88,%eax
  1015e6:	85 c0                	test   %eax,%eax
  1015e8:	75 0c                	jne    1015f6 <cons_init+0x2a>
        cprintf("serial port does not exist!!\n");
  1015ea:	c7 04 24 69 63 10 00 	movl   $0x106369,(%esp)
  1015f1:	e8 46 ed ff ff       	call   10033c <cprintf>
    }
}
  1015f6:	c9                   	leave  
  1015f7:	c3                   	ret    

001015f8 <cons_putc>:

/* cons_putc - print a single character @c to console devices */
void
cons_putc(int c) {
  1015f8:	55                   	push   %ebp
  1015f9:	89 e5                	mov    %esp,%ebp
  1015fb:	83 ec 28             	sub    $0x28,%esp
    bool intr_flag;
    local_intr_save(intr_flag);
  1015fe:	e8 e2 f7 ff ff       	call   100de5 <__intr_save>
  101603:	89 45 f4             	mov    %eax,-0xc(%ebp)
    {
        lpt_putc(c);
  101606:	8b 45 08             	mov    0x8(%ebp),%eax
  101609:	89 04 24             	mov    %eax,(%esp)
  10160c:	e8 9b fa ff ff       	call   1010ac <lpt_putc>
        cga_putc(c);
  101611:	8b 45 08             	mov    0x8(%ebp),%eax
  101614:	89 04 24             	mov    %eax,(%esp)
  101617:	e8 cf fa ff ff       	call   1010eb <cga_putc>
        serial_putc(c);
  10161c:	8b 45 08             	mov    0x8(%ebp),%eax
  10161f:	89 04 24             	mov    %eax,(%esp)
  101622:	e8 f1 fc ff ff       	call   101318 <serial_putc>
    }
    local_intr_restore(intr_flag);
  101627:	8b 45 f4             	mov    -0xc(%ebp),%eax
  10162a:	89 04 24             	mov    %eax,(%esp)
  10162d:	e8 dd f7 ff ff       	call   100e0f <__intr_restore>
}
  101632:	c9                   	leave  
  101633:	c3                   	ret    

00101634 <cons_getc>:
/* *
 * cons_getc - return the next input character from console,
 * or 0 if none waiting.
 * */
int
cons_getc(void) {
  101634:	55                   	push   %ebp
  101635:	89 e5                	mov    %esp,%ebp
  101637:	83 ec 28             	sub    $0x28,%esp
    int c = 0;
  10163a:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)
    bool intr_flag;
    local_intr_save(intr_flag);
  101641:	e8 9f f7 ff ff       	call   100de5 <__intr_save>
  101646:	89 45 f0             	mov    %eax,-0x10(%ebp)
    {
        // poll for any pending input characters,
        // so that this function works even when interrupts are disabled
        // (e.g., when called from the kernel monitor).
        serial_intr();
  101649:	e8 ab fd ff ff       	call   1013f9 <serial_intr>
        kbd_intr();
  10164e:	e8 4c ff ff ff       	call   10159f <kbd_intr>

        // grab the next character from the input buffer.
        if (cons.rpos != cons.wpos) {
  101653:	8b 15 a0 80 11 00    	mov    0x1180a0,%edx
  101659:	a1 a4 80 11 00       	mov    0x1180a4,%eax
  10165e:	39 c2                	cmp    %eax,%edx
  101660:	74 31                	je     101693 <cons_getc+0x5f>
            c = cons.buf[cons.rpos ++];
  101662:	a1 a0 80 11 00       	mov    0x1180a0,%eax
  101667:	8d 50 01             	lea    0x1(%eax),%edx
  10166a:	89 15 a0 80 11 00    	mov    %edx,0x1180a0
  101670:	0f b6 80 a0 7e 11 00 	movzbl 0x117ea0(%eax),%eax
  101677:	0f b6 c0             	movzbl %al,%eax
  10167a:	89 45 f4             	mov    %eax,-0xc(%ebp)
            if (cons.rpos == CONSBUFSIZE) {
  10167d:	a1 a0 80 11 00       	mov    0x1180a0,%eax
  101682:	3d 00 02 00 00       	cmp    $0x200,%eax
  101687:	75 0a                	jne    101693 <cons_getc+0x5f>
                cons.rpos = 0;
  101689:	c7 05 a0 80 11 00 00 	movl   $0x0,0x1180a0
  101690:	00 00 00 
            }
        }
    }
    local_intr_restore(intr_flag);
  101693:	8b 45 f0             	mov    -0x10(%ebp),%eax
  101696:	89 04 24             	mov    %eax,(%esp)
  101699:	e8 71 f7 ff ff       	call   100e0f <__intr_restore>
    return c;
  10169e:	8b 45 f4             	mov    -0xc(%ebp),%eax
}
  1016a1:	c9                   	leave  
  1016a2:	c3                   	ret    

001016a3 <intr_enable>:
#include <x86.h>
#include <intr.h>

/* intr_enable - enable irq interrupt */
void
intr_enable(void) {
  1016a3:	55                   	push   %ebp
  1016a4:	89 e5                	mov    %esp,%ebp
    asm volatile ("lidt (%0)" :: "r" (pd) : "memory");
}

static inline void
sti(void) {
    asm volatile ("sti");
  1016a6:	fb                   	sti    
    sti();
}
  1016a7:	5d                   	pop    %ebp
  1016a8:	c3                   	ret    

001016a9 <intr_disable>:

/* intr_disable - disable irq interrupt */
void
intr_disable(void) {
  1016a9:	55                   	push   %ebp
  1016aa:	89 e5                	mov    %esp,%ebp
}

static inline void
cli(void) {
    asm volatile ("cli" ::: "memory");
  1016ac:	fa                   	cli    
    cli();
}
  1016ad:	5d                   	pop    %ebp
  1016ae:	c3                   	ret    

001016af <pic_setmask>:
// Initial IRQ mask has interrupt 2 enabled (for slave 8259A).
static uint16_t irq_mask = 0xFFFF & ~(1 << IRQ_SLAVE);
static bool did_init = 0;

static void
pic_setmask(uint16_t mask) {
  1016af:	55                   	push   %ebp
  1016b0:	89 e5                	mov    %esp,%ebp
  1016b2:	83 ec 14             	sub    $0x14,%esp
  1016b5:	8b 45 08             	mov    0x8(%ebp),%eax
  1016b8:	66 89 45 ec          	mov    %ax,-0x14(%ebp)
    irq_mask = mask;
  1016bc:	0f b7 45 ec          	movzwl -0x14(%ebp),%eax
  1016c0:	66 a3 70 75 11 00    	mov    %ax,0x117570
    if (did_init) {
  1016c6:	a1 ac 80 11 00       	mov    0x1180ac,%eax
  1016cb:	85 c0                	test   %eax,%eax
  1016cd:	74 36                	je     101705 <pic_setmask+0x56>
        outb(IO_PIC1 + 1, mask);
  1016cf:	0f b7 45 ec          	movzwl -0x14(%ebp),%eax
  1016d3:	0f b6 c0             	movzbl %al,%eax
  1016d6:	66 c7 45 fe 21 00    	movw   $0x21,-0x2(%ebp)
  1016dc:	88 45 fd             	mov    %al,-0x3(%ebp)
        : "memory", "cc");
}

static inline void
outb(uint16_t port, uint8_t data) {
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
  1016df:	0f b6 45 fd          	movzbl -0x3(%ebp),%eax
  1016e3:	0f b7 55 fe          	movzwl -0x2(%ebp),%edx
  1016e7:	ee                   	out    %al,(%dx)
        outb(IO_PIC2 + 1, mask >> 8);
  1016e8:	0f b7 45 ec          	movzwl -0x14(%ebp),%eax
  1016ec:	66 c1 e8 08          	shr    $0x8,%ax
  1016f0:	0f b6 c0             	movzbl %al,%eax
  1016f3:	66 c7 45 fa a1 00    	movw   $0xa1,-0x6(%ebp)
  1016f9:	88 45 f9             	mov    %al,-0x7(%ebp)
  1016fc:	0f b6 45 f9          	movzbl -0x7(%ebp),%eax
  101700:	0f b7 55 fa          	movzwl -0x6(%ebp),%edx
  101704:	ee                   	out    %al,(%dx)
    }
}
  101705:	c9                   	leave  
  101706:	c3                   	ret    

00101707 <pic_enable>:

void
pic_enable(unsigned int irq) {
  101707:	55                   	push   %ebp
  101708:	89 e5                	mov    %esp,%ebp
  10170a:	83 ec 04             	sub    $0x4,%esp
    pic_setmask(irq_mask & ~(1 << irq));
  10170d:	8b 45 08             	mov    0x8(%ebp),%eax
  101710:	ba 01 00 00 00       	mov    $0x1,%edx
  101715:	89 c1                	mov    %eax,%ecx
  101717:	d3 e2                	shl    %cl,%edx
  101719:	89 d0                	mov    %edx,%eax
  10171b:	f7 d0                	not    %eax
  10171d:	89 c2                	mov    %eax,%edx
  10171f:	0f b7 05 70 75 11 00 	movzwl 0x117570,%eax
  101726:	21 d0                	and    %edx,%eax
  101728:	0f b7 c0             	movzwl %ax,%eax
  10172b:	89 04 24             	mov    %eax,(%esp)
  10172e:	e8 7c ff ff ff       	call   1016af <pic_setmask>
}
  101733:	c9                   	leave  
  101734:	c3                   	ret    

00101735 <pic_init>:

/* pic_init - initialize the 8259A interrupt controllers */
void
pic_init(void) {
  101735:	55                   	push   %ebp
  101736:	89 e5                	mov    %esp,%ebp
  101738:	83 ec 44             	sub    $0x44,%esp
    did_init = 1;
  10173b:	c7 05 ac 80 11 00 01 	movl   $0x1,0x1180ac
  101742:	00 00 00 
  101745:	66 c7 45 fe 21 00    	movw   $0x21,-0x2(%ebp)
  10174b:	c6 45 fd ff          	movb   $0xff,-0x3(%ebp)
  10174f:	0f b6 45 fd          	movzbl -0x3(%ebp),%eax
  101753:	0f b7 55 fe          	movzwl -0x2(%ebp),%edx
  101757:	ee                   	out    %al,(%dx)
  101758:	66 c7 45 fa a1 00    	movw   $0xa1,-0x6(%ebp)
  10175e:	c6 45 f9 ff          	movb   $0xff,-0x7(%ebp)
  101762:	0f b6 45 f9          	movzbl -0x7(%ebp),%eax
  101766:	0f b7 55 fa          	movzwl -0x6(%ebp),%edx
  10176a:	ee                   	out    %al,(%dx)
  10176b:	66 c7 45 f6 20 00    	movw   $0x20,-0xa(%ebp)
  101771:	c6 45 f5 11          	movb   $0x11,-0xb(%ebp)
  101775:	0f b6 45 f5          	movzbl -0xb(%ebp),%eax
  101779:	0f b7 55 f6          	movzwl -0xa(%ebp),%edx
  10177d:	ee                   	out    %al,(%dx)
  10177e:	66 c7 45 f2 21 00    	movw   $0x21,-0xe(%ebp)
  101784:	c6 45 f1 20          	movb   $0x20,-0xf(%ebp)
  101788:	0f b6 45 f1          	movzbl -0xf(%ebp),%eax
  10178c:	0f b7 55 f2          	movzwl -0xe(%ebp),%edx
  101790:	ee                   	out    %al,(%dx)
  101791:	66 c7 45 ee 21 00    	movw   $0x21,-0x12(%ebp)
  101797:	c6 45 ed 04          	movb   $0x4,-0x13(%ebp)
  10179b:	0f b6 45 ed          	movzbl -0x13(%ebp),%eax
  10179f:	0f b7 55 ee          	movzwl -0x12(%ebp),%edx
  1017a3:	ee                   	out    %al,(%dx)
  1017a4:	66 c7 45 ea 21 00    	movw   $0x21,-0x16(%ebp)
  1017aa:	c6 45 e9 03          	movb   $0x3,-0x17(%ebp)
  1017ae:	0f b6 45 e9          	movzbl -0x17(%ebp),%eax
  1017b2:	0f b7 55 ea          	movzwl -0x16(%ebp),%edx
  1017b6:	ee                   	out    %al,(%dx)
  1017b7:	66 c7 45 e6 a0 00    	movw   $0xa0,-0x1a(%ebp)
  1017bd:	c6 45 e5 11          	movb   $0x11,-0x1b(%ebp)
  1017c1:	0f b6 45 e5          	movzbl -0x1b(%ebp),%eax
  1017c5:	0f b7 55 e6          	movzwl -0x1a(%ebp),%edx
  1017c9:	ee                   	out    %al,(%dx)
  1017ca:	66 c7 45 e2 a1 00    	movw   $0xa1,-0x1e(%ebp)
  1017d0:	c6 45 e1 28          	movb   $0x28,-0x1f(%ebp)
  1017d4:	0f b6 45 e1          	movzbl -0x1f(%ebp),%eax
  1017d8:	0f b7 55 e2          	movzwl -0x1e(%ebp),%edx
  1017dc:	ee                   	out    %al,(%dx)
  1017dd:	66 c7 45 de a1 00    	movw   $0xa1,-0x22(%ebp)
  1017e3:	c6 45 dd 02          	movb   $0x2,-0x23(%ebp)
  1017e7:	0f b6 45 dd          	movzbl -0x23(%ebp),%eax
  1017eb:	0f b7 55 de          	movzwl -0x22(%ebp),%edx
  1017ef:	ee                   	out    %al,(%dx)
  1017f0:	66 c7 45 da a1 00    	movw   $0xa1,-0x26(%ebp)
  1017f6:	c6 45 d9 03          	movb   $0x3,-0x27(%ebp)
  1017fa:	0f b6 45 d9          	movzbl -0x27(%ebp),%eax
  1017fe:	0f b7 55 da          	movzwl -0x26(%ebp),%edx
  101802:	ee                   	out    %al,(%dx)
  101803:	66 c7 45 d6 20 00    	movw   $0x20,-0x2a(%ebp)
  101809:	c6 45 d5 68          	movb   $0x68,-0x2b(%ebp)
  10180d:	0f b6 45 d5          	movzbl -0x2b(%ebp),%eax
  101811:	0f b7 55 d6          	movzwl -0x2a(%ebp),%edx
  101815:	ee                   	out    %al,(%dx)
  101816:	66 c7 45 d2 20 00    	movw   $0x20,-0x2e(%ebp)
  10181c:	c6 45 d1 0a          	movb   $0xa,-0x2f(%ebp)
  101820:	0f b6 45 d1          	movzbl -0x2f(%ebp),%eax
  101824:	0f b7 55 d2          	movzwl -0x2e(%ebp),%edx
  101828:	ee                   	out    %al,(%dx)
  101829:	66 c7 45 ce a0 00    	movw   $0xa0,-0x32(%ebp)
  10182f:	c6 45 cd 68          	movb   $0x68,-0x33(%ebp)
  101833:	0f b6 45 cd          	movzbl -0x33(%ebp),%eax
  101837:	0f b7 55 ce          	movzwl -0x32(%ebp),%edx
  10183b:	ee                   	out    %al,(%dx)
  10183c:	66 c7 45 ca a0 00    	movw   $0xa0,-0x36(%ebp)
  101842:	c6 45 c9 0a          	movb   $0xa,-0x37(%ebp)
  101846:	0f b6 45 c9          	movzbl -0x37(%ebp),%eax
  10184a:	0f b7 55 ca          	movzwl -0x36(%ebp),%edx
  10184e:	ee                   	out    %al,(%dx)
    outb(IO_PIC1, 0x0a);    // read IRR by default

    outb(IO_PIC2, 0x68);    // OCW3
    outb(IO_PIC2, 0x0a);    // OCW3

    if (irq_mask != 0xFFFF) {
  10184f:	0f b7 05 70 75 11 00 	movzwl 0x117570,%eax
  101856:	66 83 f8 ff          	cmp    $0xffff,%ax
  10185a:	74 12                	je     10186e <pic_init+0x139>
        pic_setmask(irq_mask);
  10185c:	0f b7 05 70 75 11 00 	movzwl 0x117570,%eax
  101863:	0f b7 c0             	movzwl %ax,%eax
  101866:	89 04 24             	mov    %eax,(%esp)
  101869:	e8 41 fe ff ff       	call   1016af <pic_setmask>
    }
}
  10186e:	c9                   	leave  
  10186f:	c3                   	ret    

00101870 <print_ticks>:
#include <console.h>
#include <kdebug.h>
#include <string.h>
#define TICK_NUM 100

static void print_ticks() {
  101870:	55                   	push   %ebp
  101871:	89 e5                	mov    %esp,%ebp
  101873:	83 ec 18             	sub    $0x18,%esp
    cprintf("%d ticks\n",TICK_NUM);
  101876:	c7 44 24 04 64 00 00 	movl   $0x64,0x4(%esp)
  10187d:	00 
  10187e:	c7 04 24 a0 63 10 00 	movl   $0x1063a0,(%esp)
  101885:	e8 b2 ea ff ff       	call   10033c <cprintf>
#ifdef DEBUG_GRADE
    cprintf("End of Test.\n");
    panic("EOT: kernel seems ok.");
#endif
}
  10188a:	c9                   	leave  
  10188b:	c3                   	ret    

0010188c <idt_init>:
    sizeof(idt) - 1, (uintptr_t)idt
};

/* idt_init - initialize IDT to each of the entry points in kern/trap/vectors.S */
void
idt_init(void) {
  10188c:	55                   	push   %ebp
  10188d:	89 e5                	mov    %esp,%ebp
  10188f:	83 ec 10             	sub    $0x10,%esp
      *     You don't know the meaning of this instruction? just google it! and check the libs/x86.h to know more.
      *     Notice: the argument of lidt is idt_pd. try to find it!
      */
    extern uintptr_t __vectors[];
    int i;
    for (i = 0; i < sizeof(idt) / sizeof(struct gatedesc); i ++) {
  101892:	c7 45 fc 00 00 00 00 	movl   $0x0,-0x4(%ebp)
  101899:	e9 c3 00 00 00       	jmp    101961 <idt_init+0xd5>
        SETGATE(idt[i], 0, GD_KTEXT, __vectors[i], DPL_KERNEL);
  10189e:	8b 45 fc             	mov    -0x4(%ebp),%eax
  1018a1:	8b 04 85 00 76 11 00 	mov    0x117600(,%eax,4),%eax
  1018a8:	89 c2                	mov    %eax,%edx
  1018aa:	8b 45 fc             	mov    -0x4(%ebp),%eax
  1018ad:	66 89 14 c5 c0 80 11 	mov    %dx,0x1180c0(,%eax,8)
  1018b4:	00 
  1018b5:	8b 45 fc             	mov    -0x4(%ebp),%eax
  1018b8:	66 c7 04 c5 c2 80 11 	movw   $0x8,0x1180c2(,%eax,8)
  1018bf:	00 08 00 
  1018c2:	8b 45 fc             	mov    -0x4(%ebp),%eax
  1018c5:	0f b6 14 c5 c4 80 11 	movzbl 0x1180c4(,%eax,8),%edx
  1018cc:	00 
  1018cd:	83 e2 e0             	and    $0xffffffe0,%edx
  1018d0:	88 14 c5 c4 80 11 00 	mov    %dl,0x1180c4(,%eax,8)
  1018d7:	8b 45 fc             	mov    -0x4(%ebp),%eax
  1018da:	0f b6 14 c5 c4 80 11 	movzbl 0x1180c4(,%eax,8),%edx
  1018e1:	00 
  1018e2:	83 e2 1f             	and    $0x1f,%edx
  1018e5:	88 14 c5 c4 80 11 00 	mov    %dl,0x1180c4(,%eax,8)
  1018ec:	8b 45 fc             	mov    -0x4(%ebp),%eax
  1018ef:	0f b6 14 c5 c5 80 11 	movzbl 0x1180c5(,%eax,8),%edx
  1018f6:	00 
  1018f7:	83 e2 f0             	and    $0xfffffff0,%edx
  1018fa:	83 ca 0e             	or     $0xe,%edx
  1018fd:	88 14 c5 c5 80 11 00 	mov    %dl,0x1180c5(,%eax,8)
  101904:	8b 45 fc             	mov    -0x4(%ebp),%eax
  101907:	0f b6 14 c5 c5 80 11 	movzbl 0x1180c5(,%eax,8),%edx
  10190e:	00 
  10190f:	83 e2 ef             	and    $0xffffffef,%edx
  101912:	88 14 c5 c5 80 11 00 	mov    %dl,0x1180c5(,%eax,8)
  101919:	8b 45 fc             	mov    -0x4(%ebp),%eax
  10191c:	0f b6 14 c5 c5 80 11 	movzbl 0x1180c5(,%eax,8),%edx
  101923:	00 
  101924:	83 e2 9f             	and    $0xffffff9f,%edx
  101927:	88 14 c5 c5 80 11 00 	mov    %dl,0x1180c5(,%eax,8)
  10192e:	8b 45 fc             	mov    -0x4(%ebp),%eax
  101931:	0f b6 14 c5 c5 80 11 	movzbl 0x1180c5(,%eax,8),%edx
  101938:	00 
  101939:	83 ca 80             	or     $0xffffff80,%edx
  10193c:	88 14 c5 c5 80 11 00 	mov    %dl,0x1180c5(,%eax,8)
  101943:	8b 45 fc             	mov    -0x4(%ebp),%eax
  101946:	8b 04 85 00 76 11 00 	mov    0x117600(,%eax,4),%eax
  10194d:	c1 e8 10             	shr    $0x10,%eax
  101950:	89 c2                	mov    %eax,%edx
  101952:	8b 45 fc             	mov    -0x4(%ebp),%eax
  101955:	66 89 14 c5 c6 80 11 	mov    %dx,0x1180c6(,%eax,8)
  10195c:	00 
      *     You don't know the meaning of this instruction? just google it! and check the libs/x86.h to know more.
      *     Notice: the argument of lidt is idt_pd. try to find it!
      */
    extern uintptr_t __vectors[];
    int i;
    for (i = 0; i < sizeof(idt) / sizeof(struct gatedesc); i ++) {
  10195d:	83 45 fc 01          	addl   $0x1,-0x4(%ebp)
  101961:	8b 45 fc             	mov    -0x4(%ebp),%eax
  101964:	3d ff 00 00 00       	cmp    $0xff,%eax
  101969:	0f 86 2f ff ff ff    	jbe    10189e <idt_init+0x12>
        SETGATE(idt[i], 0, GD_KTEXT, __vectors[i], DPL_KERNEL);
    }
	// set for switch from user to kernel
    SETGATE(idt[T_SWITCH_TOK], 0, GD_KTEXT, __vectors[T_SWITCH_TOK], DPL_USER);
  10196f:	a1 e4 77 11 00       	mov    0x1177e4,%eax
  101974:	66 a3 88 84 11 00    	mov    %ax,0x118488
  10197a:	66 c7 05 8a 84 11 00 	movw   $0x8,0x11848a
  101981:	08 00 
  101983:	0f b6 05 8c 84 11 00 	movzbl 0x11848c,%eax
  10198a:	83 e0 e0             	and    $0xffffffe0,%eax
  10198d:	a2 8c 84 11 00       	mov    %al,0x11848c
  101992:	0f b6 05 8c 84 11 00 	movzbl 0x11848c,%eax
  101999:	83 e0 1f             	and    $0x1f,%eax
  10199c:	a2 8c 84 11 00       	mov    %al,0x11848c
  1019a1:	0f b6 05 8d 84 11 00 	movzbl 0x11848d,%eax
  1019a8:	83 e0 f0             	and    $0xfffffff0,%eax
  1019ab:	83 c8 0e             	or     $0xe,%eax
  1019ae:	a2 8d 84 11 00       	mov    %al,0x11848d
  1019b3:	0f b6 05 8d 84 11 00 	movzbl 0x11848d,%eax
  1019ba:	83 e0 ef             	and    $0xffffffef,%eax
  1019bd:	a2 8d 84 11 00       	mov    %al,0x11848d
  1019c2:	0f b6 05 8d 84 11 00 	movzbl 0x11848d,%eax
  1019c9:	83 c8 60             	or     $0x60,%eax
  1019cc:	a2 8d 84 11 00       	mov    %al,0x11848d
  1019d1:	0f b6 05 8d 84 11 00 	movzbl 0x11848d,%eax
  1019d8:	83 c8 80             	or     $0xffffff80,%eax
  1019db:	a2 8d 84 11 00       	mov    %al,0x11848d
  1019e0:	a1 e4 77 11 00       	mov    0x1177e4,%eax
  1019e5:	c1 e8 10             	shr    $0x10,%eax
  1019e8:	66 a3 8e 84 11 00    	mov    %ax,0x11848e
  1019ee:	c7 45 f8 80 75 11 00 	movl   $0x117580,-0x8(%ebp)
    }
}

static inline void
lidt(struct pseudodesc *pd) {
    asm volatile ("lidt (%0)" :: "r" (pd) : "memory");
  1019f5:	8b 45 f8             	mov    -0x8(%ebp),%eax
  1019f8:	0f 01 18             	lidtl  (%eax)
	// load the IDT
    lidt(&idt_pd);
}
  1019fb:	c9                   	leave  
  1019fc:	c3                   	ret    

001019fd <trapname>:

static const char *
trapname(int trapno) {
  1019fd:	55                   	push   %ebp
  1019fe:	89 e5                	mov    %esp,%ebp
        "Alignment Check",
        "Machine-Check",
        "SIMD Floating-Point Exception"
    };

    if (trapno < sizeof(excnames)/sizeof(const char * const)) {
  101a00:	8b 45 08             	mov    0x8(%ebp),%eax
  101a03:	83 f8 13             	cmp    $0x13,%eax
  101a06:	77 0c                	ja     101a14 <trapname+0x17>
        return excnames[trapno];
  101a08:	8b 45 08             	mov    0x8(%ebp),%eax
  101a0b:	8b 04 85 00 67 10 00 	mov    0x106700(,%eax,4),%eax
  101a12:	eb 18                	jmp    101a2c <trapname+0x2f>
    }
    if (trapno >= IRQ_OFFSET && trapno < IRQ_OFFSET + 16) {
  101a14:	83 7d 08 1f          	cmpl   $0x1f,0x8(%ebp)
  101a18:	7e 0d                	jle    101a27 <trapname+0x2a>
  101a1a:	83 7d 08 2f          	cmpl   $0x2f,0x8(%ebp)
  101a1e:	7f 07                	jg     101a27 <trapname+0x2a>
        return "Hardware Interrupt";
  101a20:	b8 aa 63 10 00       	mov    $0x1063aa,%eax
  101a25:	eb 05                	jmp    101a2c <trapname+0x2f>
    }
    return "(unknown trap)";
  101a27:	b8 bd 63 10 00       	mov    $0x1063bd,%eax
}
  101a2c:	5d                   	pop    %ebp
  101a2d:	c3                   	ret    

00101a2e <trap_in_kernel>:

/* trap_in_kernel - test if trap happened in kernel */
bool
trap_in_kernel(struct trapframe *tf) {
  101a2e:	55                   	push   %ebp
  101a2f:	89 e5                	mov    %esp,%ebp
    return (tf->tf_cs == (uint16_t)KERNEL_CS);
  101a31:	8b 45 08             	mov    0x8(%ebp),%eax
  101a34:	0f b7 40 3c          	movzwl 0x3c(%eax),%eax
  101a38:	66 83 f8 08          	cmp    $0x8,%ax
  101a3c:	0f 94 c0             	sete   %al
  101a3f:	0f b6 c0             	movzbl %al,%eax
}
  101a42:	5d                   	pop    %ebp
  101a43:	c3                   	ret    

00101a44 <print_trapframe>:
    "TF", "IF", "DF", "OF", NULL, NULL, "NT", NULL,
    "RF", "VM", "AC", "VIF", "VIP", "ID", NULL, NULL,
};

void
print_trapframe(struct trapframe *tf) {
  101a44:	55                   	push   %ebp
  101a45:	89 e5                	mov    %esp,%ebp
  101a47:	83 ec 28             	sub    $0x28,%esp
    cprintf("trapframe at %p\n", tf);
  101a4a:	8b 45 08             	mov    0x8(%ebp),%eax
  101a4d:	89 44 24 04          	mov    %eax,0x4(%esp)
  101a51:	c7 04 24 fe 63 10 00 	movl   $0x1063fe,(%esp)
  101a58:	e8 df e8 ff ff       	call   10033c <cprintf>
    print_regs(&tf->tf_regs);
  101a5d:	8b 45 08             	mov    0x8(%ebp),%eax
  101a60:	89 04 24             	mov    %eax,(%esp)
  101a63:	e8 a1 01 00 00       	call   101c09 <print_regs>
    cprintf("  ds   0x----%04x\n", tf->tf_ds);
  101a68:	8b 45 08             	mov    0x8(%ebp),%eax
  101a6b:	0f b7 40 2c          	movzwl 0x2c(%eax),%eax
  101a6f:	0f b7 c0             	movzwl %ax,%eax
  101a72:	89 44 24 04          	mov    %eax,0x4(%esp)
  101a76:	c7 04 24 0f 64 10 00 	movl   $0x10640f,(%esp)
  101a7d:	e8 ba e8 ff ff       	call   10033c <cprintf>
    cprintf("  es   0x----%04x\n", tf->tf_es);
  101a82:	8b 45 08             	mov    0x8(%ebp),%eax
  101a85:	0f b7 40 28          	movzwl 0x28(%eax),%eax
  101a89:	0f b7 c0             	movzwl %ax,%eax
  101a8c:	89 44 24 04          	mov    %eax,0x4(%esp)
  101a90:	c7 04 24 22 64 10 00 	movl   $0x106422,(%esp)
  101a97:	e8 a0 e8 ff ff       	call   10033c <cprintf>
    cprintf("  fs   0x----%04x\n", tf->tf_fs);
  101a9c:	8b 45 08             	mov    0x8(%ebp),%eax
  101a9f:	0f b7 40 24          	movzwl 0x24(%eax),%eax
  101aa3:	0f b7 c0             	movzwl %ax,%eax
  101aa6:	89 44 24 04          	mov    %eax,0x4(%esp)
  101aaa:	c7 04 24 35 64 10 00 	movl   $0x106435,(%esp)
  101ab1:	e8 86 e8 ff ff       	call   10033c <cprintf>
    cprintf("  gs   0x----%04x\n", tf->tf_gs);
  101ab6:	8b 45 08             	mov    0x8(%ebp),%eax
  101ab9:	0f b7 40 20          	movzwl 0x20(%eax),%eax
  101abd:	0f b7 c0             	movzwl %ax,%eax
  101ac0:	89 44 24 04          	mov    %eax,0x4(%esp)
  101ac4:	c7 04 24 48 64 10 00 	movl   $0x106448,(%esp)
  101acb:	e8 6c e8 ff ff       	call   10033c <cprintf>
    cprintf("  trap 0x%08x %s\n", tf->tf_trapno, trapname(tf->tf_trapno));
  101ad0:	8b 45 08             	mov    0x8(%ebp),%eax
  101ad3:	8b 40 30             	mov    0x30(%eax),%eax
  101ad6:	89 04 24             	mov    %eax,(%esp)
  101ad9:	e8 1f ff ff ff       	call   1019fd <trapname>
  101ade:	8b 55 08             	mov    0x8(%ebp),%edx
  101ae1:	8b 52 30             	mov    0x30(%edx),%edx
  101ae4:	89 44 24 08          	mov    %eax,0x8(%esp)
  101ae8:	89 54 24 04          	mov    %edx,0x4(%esp)
  101aec:	c7 04 24 5b 64 10 00 	movl   $0x10645b,(%esp)
  101af3:	e8 44 e8 ff ff       	call   10033c <cprintf>
    cprintf("  err  0x%08x\n", tf->tf_err);
  101af8:	8b 45 08             	mov    0x8(%ebp),%eax
  101afb:	8b 40 34             	mov    0x34(%eax),%eax
  101afe:	89 44 24 04          	mov    %eax,0x4(%esp)
  101b02:	c7 04 24 6d 64 10 00 	movl   $0x10646d,(%esp)
  101b09:	e8 2e e8 ff ff       	call   10033c <cprintf>
    cprintf("  eip  0x%08x\n", tf->tf_eip);
  101b0e:	8b 45 08             	mov    0x8(%ebp),%eax
  101b11:	8b 40 38             	mov    0x38(%eax),%eax
  101b14:	89 44 24 04          	mov    %eax,0x4(%esp)
  101b18:	c7 04 24 7c 64 10 00 	movl   $0x10647c,(%esp)
  101b1f:	e8 18 e8 ff ff       	call   10033c <cprintf>
    cprintf("  cs   0x----%04x\n", tf->tf_cs);
  101b24:	8b 45 08             	mov    0x8(%ebp),%eax
  101b27:	0f b7 40 3c          	movzwl 0x3c(%eax),%eax
  101b2b:	0f b7 c0             	movzwl %ax,%eax
  101b2e:	89 44 24 04          	mov    %eax,0x4(%esp)
  101b32:	c7 04 24 8b 64 10 00 	movl   $0x10648b,(%esp)
  101b39:	e8 fe e7 ff ff       	call   10033c <cprintf>
    cprintf("  flag 0x%08x ", tf->tf_eflags);
  101b3e:	8b 45 08             	mov    0x8(%ebp),%eax
  101b41:	8b 40 40             	mov    0x40(%eax),%eax
  101b44:	89 44 24 04          	mov    %eax,0x4(%esp)
  101b48:	c7 04 24 9e 64 10 00 	movl   $0x10649e,(%esp)
  101b4f:	e8 e8 e7 ff ff       	call   10033c <cprintf>

    int i, j;
    for (i = 0, j = 1; i < sizeof(IA32flags) / sizeof(IA32flags[0]); i ++, j <<= 1) {
  101b54:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)
  101b5b:	c7 45 f0 01 00 00 00 	movl   $0x1,-0x10(%ebp)
  101b62:	eb 3e                	jmp    101ba2 <print_trapframe+0x15e>
        if ((tf->tf_eflags & j) && IA32flags[i] != NULL) {
  101b64:	8b 45 08             	mov    0x8(%ebp),%eax
  101b67:	8b 50 40             	mov    0x40(%eax),%edx
  101b6a:	8b 45 f0             	mov    -0x10(%ebp),%eax
  101b6d:	21 d0                	and    %edx,%eax
  101b6f:	85 c0                	test   %eax,%eax
  101b71:	74 28                	je     101b9b <print_trapframe+0x157>
  101b73:	8b 45 f4             	mov    -0xc(%ebp),%eax
  101b76:	8b 04 85 a0 75 11 00 	mov    0x1175a0(,%eax,4),%eax
  101b7d:	85 c0                	test   %eax,%eax
  101b7f:	74 1a                	je     101b9b <print_trapframe+0x157>
            cprintf("%s,", IA32flags[i]);
  101b81:	8b 45 f4             	mov    -0xc(%ebp),%eax
  101b84:	8b 04 85 a0 75 11 00 	mov    0x1175a0(,%eax,4),%eax
  101b8b:	89 44 24 04          	mov    %eax,0x4(%esp)
  101b8f:	c7 04 24 ad 64 10 00 	movl   $0x1064ad,(%esp)
  101b96:	e8 a1 e7 ff ff       	call   10033c <cprintf>
    cprintf("  eip  0x%08x\n", tf->tf_eip);
    cprintf("  cs   0x----%04x\n", tf->tf_cs);
    cprintf("  flag 0x%08x ", tf->tf_eflags);

    int i, j;
    for (i = 0, j = 1; i < sizeof(IA32flags) / sizeof(IA32flags[0]); i ++, j <<= 1) {
  101b9b:	83 45 f4 01          	addl   $0x1,-0xc(%ebp)
  101b9f:	d1 65 f0             	shll   -0x10(%ebp)
  101ba2:	8b 45 f4             	mov    -0xc(%ebp),%eax
  101ba5:	83 f8 17             	cmp    $0x17,%eax
  101ba8:	76 ba                	jbe    101b64 <print_trapframe+0x120>
        if ((tf->tf_eflags & j) && IA32flags[i] != NULL) {
            cprintf("%s,", IA32flags[i]);
        }
    }
    cprintf("IOPL=%d\n", (tf->tf_eflags & FL_IOPL_MASK) >> 12);
  101baa:	8b 45 08             	mov    0x8(%ebp),%eax
  101bad:	8b 40 40             	mov    0x40(%eax),%eax
  101bb0:	25 00 30 00 00       	and    $0x3000,%eax
  101bb5:	c1 e8 0c             	shr    $0xc,%eax
  101bb8:	89 44 24 04          	mov    %eax,0x4(%esp)
  101bbc:	c7 04 24 b1 64 10 00 	movl   $0x1064b1,(%esp)
  101bc3:	e8 74 e7 ff ff       	call   10033c <cprintf>

    if (!trap_in_kernel(tf)) {
  101bc8:	8b 45 08             	mov    0x8(%ebp),%eax
  101bcb:	89 04 24             	mov    %eax,(%esp)
  101bce:	e8 5b fe ff ff       	call   101a2e <trap_in_kernel>
  101bd3:	85 c0                	test   %eax,%eax
  101bd5:	75 30                	jne    101c07 <print_trapframe+0x1c3>
        cprintf("  esp  0x%08x\n", tf->tf_esp);
  101bd7:	8b 45 08             	mov    0x8(%ebp),%eax
  101bda:	8b 40 44             	mov    0x44(%eax),%eax
  101bdd:	89 44 24 04          	mov    %eax,0x4(%esp)
  101be1:	c7 04 24 ba 64 10 00 	movl   $0x1064ba,(%esp)
  101be8:	e8 4f e7 ff ff       	call   10033c <cprintf>
        cprintf("  ss   0x----%04x\n", tf->tf_ss);
  101bed:	8b 45 08             	mov    0x8(%ebp),%eax
  101bf0:	0f b7 40 48          	movzwl 0x48(%eax),%eax
  101bf4:	0f b7 c0             	movzwl %ax,%eax
  101bf7:	89 44 24 04          	mov    %eax,0x4(%esp)
  101bfb:	c7 04 24 c9 64 10 00 	movl   $0x1064c9,(%esp)
  101c02:	e8 35 e7 ff ff       	call   10033c <cprintf>
    }
}
  101c07:	c9                   	leave  
  101c08:	c3                   	ret    

00101c09 <print_regs>:

void
print_regs(struct pushregs *regs) {
  101c09:	55                   	push   %ebp
  101c0a:	89 e5                	mov    %esp,%ebp
  101c0c:	83 ec 18             	sub    $0x18,%esp
    cprintf("  edi  0x%08x\n", regs->reg_edi);
  101c0f:	8b 45 08             	mov    0x8(%ebp),%eax
  101c12:	8b 00                	mov    (%eax),%eax
  101c14:	89 44 24 04          	mov    %eax,0x4(%esp)
  101c18:	c7 04 24 dc 64 10 00 	movl   $0x1064dc,(%esp)
  101c1f:	e8 18 e7 ff ff       	call   10033c <cprintf>
    cprintf("  esi  0x%08x\n", regs->reg_esi);
  101c24:	8b 45 08             	mov    0x8(%ebp),%eax
  101c27:	8b 40 04             	mov    0x4(%eax),%eax
  101c2a:	89 44 24 04          	mov    %eax,0x4(%esp)
  101c2e:	c7 04 24 eb 64 10 00 	movl   $0x1064eb,(%esp)
  101c35:	e8 02 e7 ff ff       	call   10033c <cprintf>
    cprintf("  ebp  0x%08x\n", regs->reg_ebp);
  101c3a:	8b 45 08             	mov    0x8(%ebp),%eax
  101c3d:	8b 40 08             	mov    0x8(%eax),%eax
  101c40:	89 44 24 04          	mov    %eax,0x4(%esp)
  101c44:	c7 04 24 fa 64 10 00 	movl   $0x1064fa,(%esp)
  101c4b:	e8 ec e6 ff ff       	call   10033c <cprintf>
    cprintf("  oesp 0x%08x\n", regs->reg_oesp);
  101c50:	8b 45 08             	mov    0x8(%ebp),%eax
  101c53:	8b 40 0c             	mov    0xc(%eax),%eax
  101c56:	89 44 24 04          	mov    %eax,0x4(%esp)
  101c5a:	c7 04 24 09 65 10 00 	movl   $0x106509,(%esp)
  101c61:	e8 d6 e6 ff ff       	call   10033c <cprintf>
    cprintf("  ebx  0x%08x\n", regs->reg_ebx);
  101c66:	8b 45 08             	mov    0x8(%ebp),%eax
  101c69:	8b 40 10             	mov    0x10(%eax),%eax
  101c6c:	89 44 24 04          	mov    %eax,0x4(%esp)
  101c70:	c7 04 24 18 65 10 00 	movl   $0x106518,(%esp)
  101c77:	e8 c0 e6 ff ff       	call   10033c <cprintf>
    cprintf("  edx  0x%08x\n", regs->reg_edx);
  101c7c:	8b 45 08             	mov    0x8(%ebp),%eax
  101c7f:	8b 40 14             	mov    0x14(%eax),%eax
  101c82:	89 44 24 04          	mov    %eax,0x4(%esp)
  101c86:	c7 04 24 27 65 10 00 	movl   $0x106527,(%esp)
  101c8d:	e8 aa e6 ff ff       	call   10033c <cprintf>
    cprintf("  ecx  0x%08x\n", regs->reg_ecx);
  101c92:	8b 45 08             	mov    0x8(%ebp),%eax
  101c95:	8b 40 18             	mov    0x18(%eax),%eax
  101c98:	89 44 24 04          	mov    %eax,0x4(%esp)
  101c9c:	c7 04 24 36 65 10 00 	movl   $0x106536,(%esp)
  101ca3:	e8 94 e6 ff ff       	call   10033c <cprintf>
    cprintf("  eax  0x%08x\n", regs->reg_eax);
  101ca8:	8b 45 08             	mov    0x8(%ebp),%eax
  101cab:	8b 40 1c             	mov    0x1c(%eax),%eax
  101cae:	89 44 24 04          	mov    %eax,0x4(%esp)
  101cb2:	c7 04 24 45 65 10 00 	movl   $0x106545,(%esp)
  101cb9:	e8 7e e6 ff ff       	call   10033c <cprintf>
}
  101cbe:	c9                   	leave  
  101cbf:	c3                   	ret    

00101cc0 <trap_dispatch>:
/* temporary trapframe or pointer to trapframe */
struct trapframe switchk2u, *switchu2k;

/* trap_dispatch - dispatch based on what type of trap occurred */
static void
trap_dispatch(struct trapframe *tf) {
  101cc0:	55                   	push   %ebp
  101cc1:	89 e5                	mov    %esp,%ebp
  101cc3:	57                   	push   %edi
  101cc4:	56                   	push   %esi
  101cc5:	53                   	push   %ebx
  101cc6:	83 ec 2c             	sub    $0x2c,%esp
    char c;

    switch (tf->tf_trapno) {
  101cc9:	8b 45 08             	mov    0x8(%ebp),%eax
  101ccc:	8b 40 30             	mov    0x30(%eax),%eax
  101ccf:	83 f8 2f             	cmp    $0x2f,%eax
  101cd2:	77 21                	ja     101cf5 <trap_dispatch+0x35>
  101cd4:	83 f8 2e             	cmp    $0x2e,%eax
  101cd7:	0f 83 ec 01 00 00    	jae    101ec9 <trap_dispatch+0x209>
  101cdd:	83 f8 21             	cmp    $0x21,%eax
  101ce0:	0f 84 8a 00 00 00    	je     101d70 <trap_dispatch+0xb0>
  101ce6:	83 f8 24             	cmp    $0x24,%eax
  101ce9:	74 5c                	je     101d47 <trap_dispatch+0x87>
  101ceb:	83 f8 20             	cmp    $0x20,%eax
  101cee:	74 1c                	je     101d0c <trap_dispatch+0x4c>
  101cf0:	e9 9c 01 00 00       	jmp    101e91 <trap_dispatch+0x1d1>
  101cf5:	83 f8 78             	cmp    $0x78,%eax
  101cf8:	0f 84 9b 00 00 00    	je     101d99 <trap_dispatch+0xd9>
  101cfe:	83 f8 79             	cmp    $0x79,%eax
  101d01:	0f 84 11 01 00 00    	je     101e18 <trap_dispatch+0x158>
  101d07:	e9 85 01 00 00       	jmp    101e91 <trap_dispatch+0x1d1>
        /* handle the timer interrupt */
        /* (1) After a timer interrupt, you should record this event using a global variable (increase it), such as ticks in kern/driver/clock.c
         * (2) Every TICK_NUM cycle, you can print some info using a funciton, such as print_ticks().
         * (3) Too Simple? Yes, I think so!
         */
        ticks ++;
  101d0c:	a1 4c 89 11 00       	mov    0x11894c,%eax
  101d11:	83 c0 01             	add    $0x1,%eax
  101d14:	a3 4c 89 11 00       	mov    %eax,0x11894c
        if (ticks % TICK_NUM == 0) {
  101d19:	8b 0d 4c 89 11 00    	mov    0x11894c,%ecx
  101d1f:	ba 1f 85 eb 51       	mov    $0x51eb851f,%edx
  101d24:	89 c8                	mov    %ecx,%eax
  101d26:	f7 e2                	mul    %edx
  101d28:	89 d0                	mov    %edx,%eax
  101d2a:	c1 e8 05             	shr    $0x5,%eax
  101d2d:	6b c0 64             	imul   $0x64,%eax,%eax
  101d30:	29 c1                	sub    %eax,%ecx
  101d32:	89 c8                	mov    %ecx,%eax
  101d34:	85 c0                	test   %eax,%eax
  101d36:	75 0a                	jne    101d42 <trap_dispatch+0x82>
            print_ticks();
  101d38:	e8 33 fb ff ff       	call   101870 <print_ticks>
        }
        break;
  101d3d:	e9 88 01 00 00       	jmp    101eca <trap_dispatch+0x20a>
  101d42:	e9 83 01 00 00       	jmp    101eca <trap_dispatch+0x20a>
    case IRQ_OFFSET + IRQ_COM1:
        c = cons_getc();
  101d47:	e8 e8 f8 ff ff       	call   101634 <cons_getc>
  101d4c:	88 45 e7             	mov    %al,-0x19(%ebp)
        cprintf("serial [%03d] %c\n", c, c);
  101d4f:	0f be 55 e7          	movsbl -0x19(%ebp),%edx
  101d53:	0f be 45 e7          	movsbl -0x19(%ebp),%eax
  101d57:	89 54 24 08          	mov    %edx,0x8(%esp)
  101d5b:	89 44 24 04          	mov    %eax,0x4(%esp)
  101d5f:	c7 04 24 54 65 10 00 	movl   $0x106554,(%esp)
  101d66:	e8 d1 e5 ff ff       	call   10033c <cprintf>
        break;
  101d6b:	e9 5a 01 00 00       	jmp    101eca <trap_dispatch+0x20a>
    case IRQ_OFFSET + IRQ_KBD:
        c = cons_getc();
  101d70:	e8 bf f8 ff ff       	call   101634 <cons_getc>
  101d75:	88 45 e7             	mov    %al,-0x19(%ebp)
        cprintf("kbd [%03d] %c\n", c, c);
  101d78:	0f be 55 e7          	movsbl -0x19(%ebp),%edx
  101d7c:	0f be 45 e7          	movsbl -0x19(%ebp),%eax
  101d80:	89 54 24 08          	mov    %edx,0x8(%esp)
  101d84:	89 44 24 04          	mov    %eax,0x4(%esp)
  101d88:	c7 04 24 66 65 10 00 	movl   $0x106566,(%esp)
  101d8f:	e8 a8 e5 ff ff       	call   10033c <cprintf>
        break;
  101d94:	e9 31 01 00 00       	jmp    101eca <trap_dispatch+0x20a>
    //LAB1 CHALLENGE 1 : YOUR CODE you should modify below codes.
    case T_SWITCH_TOU:
        if (tf->tf_cs != USER_CS) {
  101d99:	8b 45 08             	mov    0x8(%ebp),%eax
  101d9c:	0f b7 40 3c          	movzwl 0x3c(%eax),%eax
  101da0:	66 83 f8 1b          	cmp    $0x1b,%ax
  101da4:	74 6d                	je     101e13 <trap_dispatch+0x153>
            switchk2u = *tf;
  101da6:	8b 45 08             	mov    0x8(%ebp),%eax
  101da9:	ba 60 89 11 00       	mov    $0x118960,%edx
  101dae:	89 c3                	mov    %eax,%ebx
  101db0:	b8 13 00 00 00       	mov    $0x13,%eax
  101db5:	89 d7                	mov    %edx,%edi
  101db7:	89 de                	mov    %ebx,%esi
  101db9:	89 c1                	mov    %eax,%ecx
  101dbb:	f3 a5                	rep movsl %ds:(%esi),%es:(%edi)
            switchk2u.tf_cs = USER_CS;
  101dbd:	66 c7 05 9c 89 11 00 	movw   $0x1b,0x11899c
  101dc4:	1b 00 
            switchk2u.tf_ds = switchk2u.tf_es = switchk2u.tf_ss = USER_DS;
  101dc6:	66 c7 05 a8 89 11 00 	movw   $0x23,0x1189a8
  101dcd:	23 00 
  101dcf:	0f b7 05 a8 89 11 00 	movzwl 0x1189a8,%eax
  101dd6:	66 a3 88 89 11 00    	mov    %ax,0x118988
  101ddc:	0f b7 05 88 89 11 00 	movzwl 0x118988,%eax
  101de3:	66 a3 8c 89 11 00    	mov    %ax,0x11898c
            switchk2u.tf_esp = (uint32_t)tf + sizeof(struct trapframe) - 8;
  101de9:	8b 45 08             	mov    0x8(%ebp),%eax
  101dec:	83 c0 44             	add    $0x44,%eax
  101def:	a3 a4 89 11 00       	mov    %eax,0x1189a4
		
            // set eflags, make sure ucore can use io under user mode.
            // if CPL > IOPL, then cpu will generate a general protection.
            switchk2u.tf_eflags |= FL_IOPL_MASK;
  101df4:	a1 a0 89 11 00       	mov    0x1189a0,%eax
  101df9:	80 cc 30             	or     $0x30,%ah
  101dfc:	a3 a0 89 11 00       	mov    %eax,0x1189a0
		
            // set temporary stack
            // then iret will jump to the right stack
            *((uint32_t *)tf - 1) = (uint32_t)&switchk2u;
  101e01:	8b 45 08             	mov    0x8(%ebp),%eax
  101e04:	8d 50 fc             	lea    -0x4(%eax),%edx
  101e07:	b8 60 89 11 00       	mov    $0x118960,%eax
  101e0c:	89 02                	mov    %eax,(%edx)
        }
        break;
  101e0e:	e9 b7 00 00 00       	jmp    101eca <trap_dispatch+0x20a>
  101e13:	e9 b2 00 00 00       	jmp    101eca <trap_dispatch+0x20a>
    case T_SWITCH_TOK:
        if (tf->tf_cs != KERNEL_CS) {
  101e18:	8b 45 08             	mov    0x8(%ebp),%eax
  101e1b:	0f b7 40 3c          	movzwl 0x3c(%eax),%eax
  101e1f:	66 83 f8 08          	cmp    $0x8,%ax
  101e23:	74 6a                	je     101e8f <trap_dispatch+0x1cf>
            tf->tf_cs = KERNEL_CS;
  101e25:	8b 45 08             	mov    0x8(%ebp),%eax
  101e28:	66 c7 40 3c 08 00    	movw   $0x8,0x3c(%eax)
            tf->tf_ds = tf->tf_es = KERNEL_DS;
  101e2e:	8b 45 08             	mov    0x8(%ebp),%eax
  101e31:	66 c7 40 28 10 00    	movw   $0x10,0x28(%eax)
  101e37:	8b 45 08             	mov    0x8(%ebp),%eax
  101e3a:	0f b7 50 28          	movzwl 0x28(%eax),%edx
  101e3e:	8b 45 08             	mov    0x8(%ebp),%eax
  101e41:	66 89 50 2c          	mov    %dx,0x2c(%eax)
            tf->tf_eflags &= ~FL_IOPL_MASK;
  101e45:	8b 45 08             	mov    0x8(%ebp),%eax
  101e48:	8b 40 40             	mov    0x40(%eax),%eax
  101e4b:	80 e4 cf             	and    $0xcf,%ah
  101e4e:	89 c2                	mov    %eax,%edx
  101e50:	8b 45 08             	mov    0x8(%ebp),%eax
  101e53:	89 50 40             	mov    %edx,0x40(%eax)
            switchu2k = (struct trapframe *)(tf->tf_esp - (sizeof(struct trapframe) - 8));
  101e56:	8b 45 08             	mov    0x8(%ebp),%eax
  101e59:	8b 40 44             	mov    0x44(%eax),%eax
  101e5c:	83 e8 44             	sub    $0x44,%eax
  101e5f:	a3 ac 89 11 00       	mov    %eax,0x1189ac
            memmove(switchu2k, tf, sizeof(struct trapframe) - 8);
  101e64:	a1 ac 89 11 00       	mov    0x1189ac,%eax
  101e69:	c7 44 24 08 44 00 00 	movl   $0x44,0x8(%esp)
  101e70:	00 
  101e71:	8b 55 08             	mov    0x8(%ebp),%edx
  101e74:	89 54 24 04          	mov    %edx,0x4(%esp)
  101e78:	89 04 24             	mov    %eax,(%esp)
  101e7b:	e8 68 40 00 00       	call   105ee8 <memmove>
            *((uint32_t *)tf - 1) = (uint32_t)switchu2k;
  101e80:	8b 45 08             	mov    0x8(%ebp),%eax
  101e83:	8d 50 fc             	lea    -0x4(%eax),%edx
  101e86:	a1 ac 89 11 00       	mov    0x1189ac,%eax
  101e8b:	89 02                	mov    %eax,(%edx)
        }
        break;
  101e8d:	eb 3b                	jmp    101eca <trap_dispatch+0x20a>
  101e8f:	eb 39                	jmp    101eca <trap_dispatch+0x20a>
    case IRQ_OFFSET + IRQ_IDE2:
        /* do nothing */
        break;
    default:
        // in kernel, it must be a mistake
        if ((tf->tf_cs & 3) == 0) {
  101e91:	8b 45 08             	mov    0x8(%ebp),%eax
  101e94:	0f b7 40 3c          	movzwl 0x3c(%eax),%eax
  101e98:	0f b7 c0             	movzwl %ax,%eax
  101e9b:	83 e0 03             	and    $0x3,%eax
  101e9e:	85 c0                	test   %eax,%eax
  101ea0:	75 28                	jne    101eca <trap_dispatch+0x20a>
            print_trapframe(tf);
  101ea2:	8b 45 08             	mov    0x8(%ebp),%eax
  101ea5:	89 04 24             	mov    %eax,(%esp)
  101ea8:	e8 97 fb ff ff       	call   101a44 <print_trapframe>
            panic("unexpected trap in kernel.\n");
  101ead:	c7 44 24 08 75 65 10 	movl   $0x106575,0x8(%esp)
  101eb4:	00 
  101eb5:	c7 44 24 04 d2 00 00 	movl   $0xd2,0x4(%esp)
  101ebc:	00 
  101ebd:	c7 04 24 91 65 10 00 	movl   $0x106591,(%esp)
  101ec4:	e8 fd ed ff ff       	call   100cc6 <__panic>
        }
        break;
    case IRQ_OFFSET + IRQ_IDE1:
    case IRQ_OFFSET + IRQ_IDE2:
        /* do nothing */
        break;
  101ec9:	90                   	nop
        if ((tf->tf_cs & 3) == 0) {
            print_trapframe(tf);
            panic("unexpected trap in kernel.\n");
        }
    }
}
  101eca:	83 c4 2c             	add    $0x2c,%esp
  101ecd:	5b                   	pop    %ebx
  101ece:	5e                   	pop    %esi
  101ecf:	5f                   	pop    %edi
  101ed0:	5d                   	pop    %ebp
  101ed1:	c3                   	ret    

00101ed2 <trap>:
 * trap - handles or dispatches an exception/interrupt. if and when trap() returns,
 * the code in kern/trap/trapentry.S restores the old CPU state saved in the
 * trapframe and then uses the iret instruction to return from the exception.
 * */
void
trap(struct trapframe *tf) {
  101ed2:	55                   	push   %ebp
  101ed3:	89 e5                	mov    %esp,%ebp
  101ed5:	83 ec 18             	sub    $0x18,%esp
    // dispatch based on what type of trap occurred
    trap_dispatch(tf);
  101ed8:	8b 45 08             	mov    0x8(%ebp),%eax
  101edb:	89 04 24             	mov    %eax,(%esp)
  101ede:	e8 dd fd ff ff       	call   101cc0 <trap_dispatch>
}
  101ee3:	c9                   	leave  
  101ee4:	c3                   	ret    

00101ee5 <__alltraps>:
.text
.globl __alltraps
__alltraps:
    # push registers to build a trap frame
    # therefore make the stack look like a struct trapframe
    pushl %ds
  101ee5:	1e                   	push   %ds
    pushl %es
  101ee6:	06                   	push   %es
    pushl %fs
  101ee7:	0f a0                	push   %fs
    pushl %gs
  101ee9:	0f a8                	push   %gs
    pushal
  101eeb:	60                   	pusha  

    # load GD_KDATA into %ds and %es to set up data segments for kernel
    movl $GD_KDATA, %eax
  101eec:	b8 10 00 00 00       	mov    $0x10,%eax
    movw %ax, %ds
  101ef1:	8e d8                	mov    %eax,%ds
    movw %ax, %es
  101ef3:	8e c0                	mov    %eax,%es

    # push %esp to pass a pointer to the trapframe as an argument to trap()
    pushl %esp
  101ef5:	54                   	push   %esp

    # call trap(tf), where tf=%esp
    call trap
  101ef6:	e8 d7 ff ff ff       	call   101ed2 <trap>

    # pop the pushed stack pointer
    popl %esp
  101efb:	5c                   	pop    %esp

00101efc <__trapret>:

    # return falls through to trapret...
.globl __trapret
__trapret:
    # restore registers from stack
    popal
  101efc:	61                   	popa   

    # restore %ds, %es, %fs and %gs
    popl %gs
  101efd:	0f a9                	pop    %gs
    popl %fs
  101eff:	0f a1                	pop    %fs
    popl %es
  101f01:	07                   	pop    %es
    popl %ds
  101f02:	1f                   	pop    %ds

    # get rid of the trap number and error code
    addl $0x8, %esp
  101f03:	83 c4 08             	add    $0x8,%esp
    iret
  101f06:	cf                   	iret   

00101f07 <vector0>:
# handler
.text
.globl __alltraps
.globl vector0
vector0:
  pushl $0
  101f07:	6a 00                	push   $0x0
  pushl $0
  101f09:	6a 00                	push   $0x0
  jmp __alltraps
  101f0b:	e9 d5 ff ff ff       	jmp    101ee5 <__alltraps>

00101f10 <vector1>:
.globl vector1
vector1:
  pushl $0
  101f10:	6a 00                	push   $0x0
  pushl $1
  101f12:	6a 01                	push   $0x1
  jmp __alltraps
  101f14:	e9 cc ff ff ff       	jmp    101ee5 <__alltraps>

00101f19 <vector2>:
.globl vector2
vector2:
  pushl $0
  101f19:	6a 00                	push   $0x0
  pushl $2
  101f1b:	6a 02                	push   $0x2
  jmp __alltraps
  101f1d:	e9 c3 ff ff ff       	jmp    101ee5 <__alltraps>

00101f22 <vector3>:
.globl vector3
vector3:
  pushl $0
  101f22:	6a 00                	push   $0x0
  pushl $3
  101f24:	6a 03                	push   $0x3
  jmp __alltraps
  101f26:	e9 ba ff ff ff       	jmp    101ee5 <__alltraps>

00101f2b <vector4>:
.globl vector4
vector4:
  pushl $0
  101f2b:	6a 00                	push   $0x0
  pushl $4
  101f2d:	6a 04                	push   $0x4
  jmp __alltraps
  101f2f:	e9 b1 ff ff ff       	jmp    101ee5 <__alltraps>

00101f34 <vector5>:
.globl vector5
vector5:
  pushl $0
  101f34:	6a 00                	push   $0x0
  pushl $5
  101f36:	6a 05                	push   $0x5
  jmp __alltraps
  101f38:	e9 a8 ff ff ff       	jmp    101ee5 <__alltraps>

00101f3d <vector6>:
.globl vector6
vector6:
  pushl $0
  101f3d:	6a 00                	push   $0x0
  pushl $6
  101f3f:	6a 06                	push   $0x6
  jmp __alltraps
  101f41:	e9 9f ff ff ff       	jmp    101ee5 <__alltraps>

00101f46 <vector7>:
.globl vector7
vector7:
  pushl $0
  101f46:	6a 00                	push   $0x0
  pushl $7
  101f48:	6a 07                	push   $0x7
  jmp __alltraps
  101f4a:	e9 96 ff ff ff       	jmp    101ee5 <__alltraps>

00101f4f <vector8>:
.globl vector8
vector8:
  pushl $8
  101f4f:	6a 08                	push   $0x8
  jmp __alltraps
  101f51:	e9 8f ff ff ff       	jmp    101ee5 <__alltraps>

00101f56 <vector9>:
.globl vector9
vector9:
  pushl $9
  101f56:	6a 09                	push   $0x9
  jmp __alltraps
  101f58:	e9 88 ff ff ff       	jmp    101ee5 <__alltraps>

00101f5d <vector10>:
.globl vector10
vector10:
  pushl $10
  101f5d:	6a 0a                	push   $0xa
  jmp __alltraps
  101f5f:	e9 81 ff ff ff       	jmp    101ee5 <__alltraps>

00101f64 <vector11>:
.globl vector11
vector11:
  pushl $11
  101f64:	6a 0b                	push   $0xb
  jmp __alltraps
  101f66:	e9 7a ff ff ff       	jmp    101ee5 <__alltraps>

00101f6b <vector12>:
.globl vector12
vector12:
  pushl $12
  101f6b:	6a 0c                	push   $0xc
  jmp __alltraps
  101f6d:	e9 73 ff ff ff       	jmp    101ee5 <__alltraps>

00101f72 <vector13>:
.globl vector13
vector13:
  pushl $13
  101f72:	6a 0d                	push   $0xd
  jmp __alltraps
  101f74:	e9 6c ff ff ff       	jmp    101ee5 <__alltraps>

00101f79 <vector14>:
.globl vector14
vector14:
  pushl $14
  101f79:	6a 0e                	push   $0xe
  jmp __alltraps
  101f7b:	e9 65 ff ff ff       	jmp    101ee5 <__alltraps>

00101f80 <vector15>:
.globl vector15
vector15:
  pushl $0
  101f80:	6a 00                	push   $0x0
  pushl $15
  101f82:	6a 0f                	push   $0xf
  jmp __alltraps
  101f84:	e9 5c ff ff ff       	jmp    101ee5 <__alltraps>

00101f89 <vector16>:
.globl vector16
vector16:
  pushl $0
  101f89:	6a 00                	push   $0x0
  pushl $16
  101f8b:	6a 10                	push   $0x10
  jmp __alltraps
  101f8d:	e9 53 ff ff ff       	jmp    101ee5 <__alltraps>

00101f92 <vector17>:
.globl vector17
vector17:
  pushl $17
  101f92:	6a 11                	push   $0x11
  jmp __alltraps
  101f94:	e9 4c ff ff ff       	jmp    101ee5 <__alltraps>

00101f99 <vector18>:
.globl vector18
vector18:
  pushl $0
  101f99:	6a 00                	push   $0x0
  pushl $18
  101f9b:	6a 12                	push   $0x12
  jmp __alltraps
  101f9d:	e9 43 ff ff ff       	jmp    101ee5 <__alltraps>

00101fa2 <vector19>:
.globl vector19
vector19:
  pushl $0
  101fa2:	6a 00                	push   $0x0
  pushl $19
  101fa4:	6a 13                	push   $0x13
  jmp __alltraps
  101fa6:	e9 3a ff ff ff       	jmp    101ee5 <__alltraps>

00101fab <vector20>:
.globl vector20
vector20:
  pushl $0
  101fab:	6a 00                	push   $0x0
  pushl $20
  101fad:	6a 14                	push   $0x14
  jmp __alltraps
  101faf:	e9 31 ff ff ff       	jmp    101ee5 <__alltraps>

00101fb4 <vector21>:
.globl vector21
vector21:
  pushl $0
  101fb4:	6a 00                	push   $0x0
  pushl $21
  101fb6:	6a 15                	push   $0x15
  jmp __alltraps
  101fb8:	e9 28 ff ff ff       	jmp    101ee5 <__alltraps>

00101fbd <vector22>:
.globl vector22
vector22:
  pushl $0
  101fbd:	6a 00                	push   $0x0
  pushl $22
  101fbf:	6a 16                	push   $0x16
  jmp __alltraps
  101fc1:	e9 1f ff ff ff       	jmp    101ee5 <__alltraps>

00101fc6 <vector23>:
.globl vector23
vector23:
  pushl $0
  101fc6:	6a 00                	push   $0x0
  pushl $23
  101fc8:	6a 17                	push   $0x17
  jmp __alltraps
  101fca:	e9 16 ff ff ff       	jmp    101ee5 <__alltraps>

00101fcf <vector24>:
.globl vector24
vector24:
  pushl $0
  101fcf:	6a 00                	push   $0x0
  pushl $24
  101fd1:	6a 18                	push   $0x18
  jmp __alltraps
  101fd3:	e9 0d ff ff ff       	jmp    101ee5 <__alltraps>

00101fd8 <vector25>:
.globl vector25
vector25:
  pushl $0
  101fd8:	6a 00                	push   $0x0
  pushl $25
  101fda:	6a 19                	push   $0x19
  jmp __alltraps
  101fdc:	e9 04 ff ff ff       	jmp    101ee5 <__alltraps>

00101fe1 <vector26>:
.globl vector26
vector26:
  pushl $0
  101fe1:	6a 00                	push   $0x0
  pushl $26
  101fe3:	6a 1a                	push   $0x1a
  jmp __alltraps
  101fe5:	e9 fb fe ff ff       	jmp    101ee5 <__alltraps>

00101fea <vector27>:
.globl vector27
vector27:
  pushl $0
  101fea:	6a 00                	push   $0x0
  pushl $27
  101fec:	6a 1b                	push   $0x1b
  jmp __alltraps
  101fee:	e9 f2 fe ff ff       	jmp    101ee5 <__alltraps>

00101ff3 <vector28>:
.globl vector28
vector28:
  pushl $0
  101ff3:	6a 00                	push   $0x0
  pushl $28
  101ff5:	6a 1c                	push   $0x1c
  jmp __alltraps
  101ff7:	e9 e9 fe ff ff       	jmp    101ee5 <__alltraps>

00101ffc <vector29>:
.globl vector29
vector29:
  pushl $0
  101ffc:	6a 00                	push   $0x0
  pushl $29
  101ffe:	6a 1d                	push   $0x1d
  jmp __alltraps
  102000:	e9 e0 fe ff ff       	jmp    101ee5 <__alltraps>

00102005 <vector30>:
.globl vector30
vector30:
  pushl $0
  102005:	6a 00                	push   $0x0
  pushl $30
  102007:	6a 1e                	push   $0x1e
  jmp __alltraps
  102009:	e9 d7 fe ff ff       	jmp    101ee5 <__alltraps>

0010200e <vector31>:
.globl vector31
vector31:
  pushl $0
  10200e:	6a 00                	push   $0x0
  pushl $31
  102010:	6a 1f                	push   $0x1f
  jmp __alltraps
  102012:	e9 ce fe ff ff       	jmp    101ee5 <__alltraps>

00102017 <vector32>:
.globl vector32
vector32:
  pushl $0
  102017:	6a 00                	push   $0x0
  pushl $32
  102019:	6a 20                	push   $0x20
  jmp __alltraps
  10201b:	e9 c5 fe ff ff       	jmp    101ee5 <__alltraps>

00102020 <vector33>:
.globl vector33
vector33:
  pushl $0
  102020:	6a 00                	push   $0x0
  pushl $33
  102022:	6a 21                	push   $0x21
  jmp __alltraps
  102024:	e9 bc fe ff ff       	jmp    101ee5 <__alltraps>

00102029 <vector34>:
.globl vector34
vector34:
  pushl $0
  102029:	6a 00                	push   $0x0
  pushl $34
  10202b:	6a 22                	push   $0x22
  jmp __alltraps
  10202d:	e9 b3 fe ff ff       	jmp    101ee5 <__alltraps>

00102032 <vector35>:
.globl vector35
vector35:
  pushl $0
  102032:	6a 00                	push   $0x0
  pushl $35
  102034:	6a 23                	push   $0x23
  jmp __alltraps
  102036:	e9 aa fe ff ff       	jmp    101ee5 <__alltraps>

0010203b <vector36>:
.globl vector36
vector36:
  pushl $0
  10203b:	6a 00                	push   $0x0
  pushl $36
  10203d:	6a 24                	push   $0x24
  jmp __alltraps
  10203f:	e9 a1 fe ff ff       	jmp    101ee5 <__alltraps>

00102044 <vector37>:
.globl vector37
vector37:
  pushl $0
  102044:	6a 00                	push   $0x0
  pushl $37
  102046:	6a 25                	push   $0x25
  jmp __alltraps
  102048:	e9 98 fe ff ff       	jmp    101ee5 <__alltraps>

0010204d <vector38>:
.globl vector38
vector38:
  pushl $0
  10204d:	6a 00                	push   $0x0
  pushl $38
  10204f:	6a 26                	push   $0x26
  jmp __alltraps
  102051:	e9 8f fe ff ff       	jmp    101ee5 <__alltraps>

00102056 <vector39>:
.globl vector39
vector39:
  pushl $0
  102056:	6a 00                	push   $0x0
  pushl $39
  102058:	6a 27                	push   $0x27
  jmp __alltraps
  10205a:	e9 86 fe ff ff       	jmp    101ee5 <__alltraps>

0010205f <vector40>:
.globl vector40
vector40:
  pushl $0
  10205f:	6a 00                	push   $0x0
  pushl $40
  102061:	6a 28                	push   $0x28
  jmp __alltraps
  102063:	e9 7d fe ff ff       	jmp    101ee5 <__alltraps>

00102068 <vector41>:
.globl vector41
vector41:
  pushl $0
  102068:	6a 00                	push   $0x0
  pushl $41
  10206a:	6a 29                	push   $0x29
  jmp __alltraps
  10206c:	e9 74 fe ff ff       	jmp    101ee5 <__alltraps>

00102071 <vector42>:
.globl vector42
vector42:
  pushl $0
  102071:	6a 00                	push   $0x0
  pushl $42
  102073:	6a 2a                	push   $0x2a
  jmp __alltraps
  102075:	e9 6b fe ff ff       	jmp    101ee5 <__alltraps>

0010207a <vector43>:
.globl vector43
vector43:
  pushl $0
  10207a:	6a 00                	push   $0x0
  pushl $43
  10207c:	6a 2b                	push   $0x2b
  jmp __alltraps
  10207e:	e9 62 fe ff ff       	jmp    101ee5 <__alltraps>

00102083 <vector44>:
.globl vector44
vector44:
  pushl $0
  102083:	6a 00                	push   $0x0
  pushl $44
  102085:	6a 2c                	push   $0x2c
  jmp __alltraps
  102087:	e9 59 fe ff ff       	jmp    101ee5 <__alltraps>

0010208c <vector45>:
.globl vector45
vector45:
  pushl $0
  10208c:	6a 00                	push   $0x0
  pushl $45
  10208e:	6a 2d                	push   $0x2d
  jmp __alltraps
  102090:	e9 50 fe ff ff       	jmp    101ee5 <__alltraps>

00102095 <vector46>:
.globl vector46
vector46:
  pushl $0
  102095:	6a 00                	push   $0x0
  pushl $46
  102097:	6a 2e                	push   $0x2e
  jmp __alltraps
  102099:	e9 47 fe ff ff       	jmp    101ee5 <__alltraps>

0010209e <vector47>:
.globl vector47
vector47:
  pushl $0
  10209e:	6a 00                	push   $0x0
  pushl $47
  1020a0:	6a 2f                	push   $0x2f
  jmp __alltraps
  1020a2:	e9 3e fe ff ff       	jmp    101ee5 <__alltraps>

001020a7 <vector48>:
.globl vector48
vector48:
  pushl $0
  1020a7:	6a 00                	push   $0x0
  pushl $48
  1020a9:	6a 30                	push   $0x30
  jmp __alltraps
  1020ab:	e9 35 fe ff ff       	jmp    101ee5 <__alltraps>

001020b0 <vector49>:
.globl vector49
vector49:
  pushl $0
  1020b0:	6a 00                	push   $0x0
  pushl $49
  1020b2:	6a 31                	push   $0x31
  jmp __alltraps
  1020b4:	e9 2c fe ff ff       	jmp    101ee5 <__alltraps>

001020b9 <vector50>:
.globl vector50
vector50:
  pushl $0
  1020b9:	6a 00                	push   $0x0
  pushl $50
  1020bb:	6a 32                	push   $0x32
  jmp __alltraps
  1020bd:	e9 23 fe ff ff       	jmp    101ee5 <__alltraps>

001020c2 <vector51>:
.globl vector51
vector51:
  pushl $0
  1020c2:	6a 00                	push   $0x0
  pushl $51
  1020c4:	6a 33                	push   $0x33
  jmp __alltraps
  1020c6:	e9 1a fe ff ff       	jmp    101ee5 <__alltraps>

001020cb <vector52>:
.globl vector52
vector52:
  pushl $0
  1020cb:	6a 00                	push   $0x0
  pushl $52
  1020cd:	6a 34                	push   $0x34
  jmp __alltraps
  1020cf:	e9 11 fe ff ff       	jmp    101ee5 <__alltraps>

001020d4 <vector53>:
.globl vector53
vector53:
  pushl $0
  1020d4:	6a 00                	push   $0x0
  pushl $53
  1020d6:	6a 35                	push   $0x35
  jmp __alltraps
  1020d8:	e9 08 fe ff ff       	jmp    101ee5 <__alltraps>

001020dd <vector54>:
.globl vector54
vector54:
  pushl $0
  1020dd:	6a 00                	push   $0x0
  pushl $54
  1020df:	6a 36                	push   $0x36
  jmp __alltraps
  1020e1:	e9 ff fd ff ff       	jmp    101ee5 <__alltraps>

001020e6 <vector55>:
.globl vector55
vector55:
  pushl $0
  1020e6:	6a 00                	push   $0x0
  pushl $55
  1020e8:	6a 37                	push   $0x37
  jmp __alltraps
  1020ea:	e9 f6 fd ff ff       	jmp    101ee5 <__alltraps>

001020ef <vector56>:
.globl vector56
vector56:
  pushl $0
  1020ef:	6a 00                	push   $0x0
  pushl $56
  1020f1:	6a 38                	push   $0x38
  jmp __alltraps
  1020f3:	e9 ed fd ff ff       	jmp    101ee5 <__alltraps>

001020f8 <vector57>:
.globl vector57
vector57:
  pushl $0
  1020f8:	6a 00                	push   $0x0
  pushl $57
  1020fa:	6a 39                	push   $0x39
  jmp __alltraps
  1020fc:	e9 e4 fd ff ff       	jmp    101ee5 <__alltraps>

00102101 <vector58>:
.globl vector58
vector58:
  pushl $0
  102101:	6a 00                	push   $0x0
  pushl $58
  102103:	6a 3a                	push   $0x3a
  jmp __alltraps
  102105:	e9 db fd ff ff       	jmp    101ee5 <__alltraps>

0010210a <vector59>:
.globl vector59
vector59:
  pushl $0
  10210a:	6a 00                	push   $0x0
  pushl $59
  10210c:	6a 3b                	push   $0x3b
  jmp __alltraps
  10210e:	e9 d2 fd ff ff       	jmp    101ee5 <__alltraps>

00102113 <vector60>:
.globl vector60
vector60:
  pushl $0
  102113:	6a 00                	push   $0x0
  pushl $60
  102115:	6a 3c                	push   $0x3c
  jmp __alltraps
  102117:	e9 c9 fd ff ff       	jmp    101ee5 <__alltraps>

0010211c <vector61>:
.globl vector61
vector61:
  pushl $0
  10211c:	6a 00                	push   $0x0
  pushl $61
  10211e:	6a 3d                	push   $0x3d
  jmp __alltraps
  102120:	e9 c0 fd ff ff       	jmp    101ee5 <__alltraps>

00102125 <vector62>:
.globl vector62
vector62:
  pushl $0
  102125:	6a 00                	push   $0x0
  pushl $62
  102127:	6a 3e                	push   $0x3e
  jmp __alltraps
  102129:	e9 b7 fd ff ff       	jmp    101ee5 <__alltraps>

0010212e <vector63>:
.globl vector63
vector63:
  pushl $0
  10212e:	6a 00                	push   $0x0
  pushl $63
  102130:	6a 3f                	push   $0x3f
  jmp __alltraps
  102132:	e9 ae fd ff ff       	jmp    101ee5 <__alltraps>

00102137 <vector64>:
.globl vector64
vector64:
  pushl $0
  102137:	6a 00                	push   $0x0
  pushl $64
  102139:	6a 40                	push   $0x40
  jmp __alltraps
  10213b:	e9 a5 fd ff ff       	jmp    101ee5 <__alltraps>

00102140 <vector65>:
.globl vector65
vector65:
  pushl $0
  102140:	6a 00                	push   $0x0
  pushl $65
  102142:	6a 41                	push   $0x41
  jmp __alltraps
  102144:	e9 9c fd ff ff       	jmp    101ee5 <__alltraps>

00102149 <vector66>:
.globl vector66
vector66:
  pushl $0
  102149:	6a 00                	push   $0x0
  pushl $66
  10214b:	6a 42                	push   $0x42
  jmp __alltraps
  10214d:	e9 93 fd ff ff       	jmp    101ee5 <__alltraps>

00102152 <vector67>:
.globl vector67
vector67:
  pushl $0
  102152:	6a 00                	push   $0x0
  pushl $67
  102154:	6a 43                	push   $0x43
  jmp __alltraps
  102156:	e9 8a fd ff ff       	jmp    101ee5 <__alltraps>

0010215b <vector68>:
.globl vector68
vector68:
  pushl $0
  10215b:	6a 00                	push   $0x0
  pushl $68
  10215d:	6a 44                	push   $0x44
  jmp __alltraps
  10215f:	e9 81 fd ff ff       	jmp    101ee5 <__alltraps>

00102164 <vector69>:
.globl vector69
vector69:
  pushl $0
  102164:	6a 00                	push   $0x0
  pushl $69
  102166:	6a 45                	push   $0x45
  jmp __alltraps
  102168:	e9 78 fd ff ff       	jmp    101ee5 <__alltraps>

0010216d <vector70>:
.globl vector70
vector70:
  pushl $0
  10216d:	6a 00                	push   $0x0
  pushl $70
  10216f:	6a 46                	push   $0x46
  jmp __alltraps
  102171:	e9 6f fd ff ff       	jmp    101ee5 <__alltraps>

00102176 <vector71>:
.globl vector71
vector71:
  pushl $0
  102176:	6a 00                	push   $0x0
  pushl $71
  102178:	6a 47                	push   $0x47
  jmp __alltraps
  10217a:	e9 66 fd ff ff       	jmp    101ee5 <__alltraps>

0010217f <vector72>:
.globl vector72
vector72:
  pushl $0
  10217f:	6a 00                	push   $0x0
  pushl $72
  102181:	6a 48                	push   $0x48
  jmp __alltraps
  102183:	e9 5d fd ff ff       	jmp    101ee5 <__alltraps>

00102188 <vector73>:
.globl vector73
vector73:
  pushl $0
  102188:	6a 00                	push   $0x0
  pushl $73
  10218a:	6a 49                	push   $0x49
  jmp __alltraps
  10218c:	e9 54 fd ff ff       	jmp    101ee5 <__alltraps>

00102191 <vector74>:
.globl vector74
vector74:
  pushl $0
  102191:	6a 00                	push   $0x0
  pushl $74
  102193:	6a 4a                	push   $0x4a
  jmp __alltraps
  102195:	e9 4b fd ff ff       	jmp    101ee5 <__alltraps>

0010219a <vector75>:
.globl vector75
vector75:
  pushl $0
  10219a:	6a 00                	push   $0x0
  pushl $75
  10219c:	6a 4b                	push   $0x4b
  jmp __alltraps
  10219e:	e9 42 fd ff ff       	jmp    101ee5 <__alltraps>

001021a3 <vector76>:
.globl vector76
vector76:
  pushl $0
  1021a3:	6a 00                	push   $0x0
  pushl $76
  1021a5:	6a 4c                	push   $0x4c
  jmp __alltraps
  1021a7:	e9 39 fd ff ff       	jmp    101ee5 <__alltraps>

001021ac <vector77>:
.globl vector77
vector77:
  pushl $0
  1021ac:	6a 00                	push   $0x0
  pushl $77
  1021ae:	6a 4d                	push   $0x4d
  jmp __alltraps
  1021b0:	e9 30 fd ff ff       	jmp    101ee5 <__alltraps>

001021b5 <vector78>:
.globl vector78
vector78:
  pushl $0
  1021b5:	6a 00                	push   $0x0
  pushl $78
  1021b7:	6a 4e                	push   $0x4e
  jmp __alltraps
  1021b9:	e9 27 fd ff ff       	jmp    101ee5 <__alltraps>

001021be <vector79>:
.globl vector79
vector79:
  pushl $0
  1021be:	6a 00                	push   $0x0
  pushl $79
  1021c0:	6a 4f                	push   $0x4f
  jmp __alltraps
  1021c2:	e9 1e fd ff ff       	jmp    101ee5 <__alltraps>

001021c7 <vector80>:
.globl vector80
vector80:
  pushl $0
  1021c7:	6a 00                	push   $0x0
  pushl $80
  1021c9:	6a 50                	push   $0x50
  jmp __alltraps
  1021cb:	e9 15 fd ff ff       	jmp    101ee5 <__alltraps>

001021d0 <vector81>:
.globl vector81
vector81:
  pushl $0
  1021d0:	6a 00                	push   $0x0
  pushl $81
  1021d2:	6a 51                	push   $0x51
  jmp __alltraps
  1021d4:	e9 0c fd ff ff       	jmp    101ee5 <__alltraps>

001021d9 <vector82>:
.globl vector82
vector82:
  pushl $0
  1021d9:	6a 00                	push   $0x0
  pushl $82
  1021db:	6a 52                	push   $0x52
  jmp __alltraps
  1021dd:	e9 03 fd ff ff       	jmp    101ee5 <__alltraps>

001021e2 <vector83>:
.globl vector83
vector83:
  pushl $0
  1021e2:	6a 00                	push   $0x0
  pushl $83
  1021e4:	6a 53                	push   $0x53
  jmp __alltraps
  1021e6:	e9 fa fc ff ff       	jmp    101ee5 <__alltraps>

001021eb <vector84>:
.globl vector84
vector84:
  pushl $0
  1021eb:	6a 00                	push   $0x0
  pushl $84
  1021ed:	6a 54                	push   $0x54
  jmp __alltraps
  1021ef:	e9 f1 fc ff ff       	jmp    101ee5 <__alltraps>

001021f4 <vector85>:
.globl vector85
vector85:
  pushl $0
  1021f4:	6a 00                	push   $0x0
  pushl $85
  1021f6:	6a 55                	push   $0x55
  jmp __alltraps
  1021f8:	e9 e8 fc ff ff       	jmp    101ee5 <__alltraps>

001021fd <vector86>:
.globl vector86
vector86:
  pushl $0
  1021fd:	6a 00                	push   $0x0
  pushl $86
  1021ff:	6a 56                	push   $0x56
  jmp __alltraps
  102201:	e9 df fc ff ff       	jmp    101ee5 <__alltraps>

00102206 <vector87>:
.globl vector87
vector87:
  pushl $0
  102206:	6a 00                	push   $0x0
  pushl $87
  102208:	6a 57                	push   $0x57
  jmp __alltraps
  10220a:	e9 d6 fc ff ff       	jmp    101ee5 <__alltraps>

0010220f <vector88>:
.globl vector88
vector88:
  pushl $0
  10220f:	6a 00                	push   $0x0
  pushl $88
  102211:	6a 58                	push   $0x58
  jmp __alltraps
  102213:	e9 cd fc ff ff       	jmp    101ee5 <__alltraps>

00102218 <vector89>:
.globl vector89
vector89:
  pushl $0
  102218:	6a 00                	push   $0x0
  pushl $89
  10221a:	6a 59                	push   $0x59
  jmp __alltraps
  10221c:	e9 c4 fc ff ff       	jmp    101ee5 <__alltraps>

00102221 <vector90>:
.globl vector90
vector90:
  pushl $0
  102221:	6a 00                	push   $0x0
  pushl $90
  102223:	6a 5a                	push   $0x5a
  jmp __alltraps
  102225:	e9 bb fc ff ff       	jmp    101ee5 <__alltraps>

0010222a <vector91>:
.globl vector91
vector91:
  pushl $0
  10222a:	6a 00                	push   $0x0
  pushl $91
  10222c:	6a 5b                	push   $0x5b
  jmp __alltraps
  10222e:	e9 b2 fc ff ff       	jmp    101ee5 <__alltraps>

00102233 <vector92>:
.globl vector92
vector92:
  pushl $0
  102233:	6a 00                	push   $0x0
  pushl $92
  102235:	6a 5c                	push   $0x5c
  jmp __alltraps
  102237:	e9 a9 fc ff ff       	jmp    101ee5 <__alltraps>

0010223c <vector93>:
.globl vector93
vector93:
  pushl $0
  10223c:	6a 00                	push   $0x0
  pushl $93
  10223e:	6a 5d                	push   $0x5d
  jmp __alltraps
  102240:	e9 a0 fc ff ff       	jmp    101ee5 <__alltraps>

00102245 <vector94>:
.globl vector94
vector94:
  pushl $0
  102245:	6a 00                	push   $0x0
  pushl $94
  102247:	6a 5e                	push   $0x5e
  jmp __alltraps
  102249:	e9 97 fc ff ff       	jmp    101ee5 <__alltraps>

0010224e <vector95>:
.globl vector95
vector95:
  pushl $0
  10224e:	6a 00                	push   $0x0
  pushl $95
  102250:	6a 5f                	push   $0x5f
  jmp __alltraps
  102252:	e9 8e fc ff ff       	jmp    101ee5 <__alltraps>

00102257 <vector96>:
.globl vector96
vector96:
  pushl $0
  102257:	6a 00                	push   $0x0
  pushl $96
  102259:	6a 60                	push   $0x60
  jmp __alltraps
  10225b:	e9 85 fc ff ff       	jmp    101ee5 <__alltraps>

00102260 <vector97>:
.globl vector97
vector97:
  pushl $0
  102260:	6a 00                	push   $0x0
  pushl $97
  102262:	6a 61                	push   $0x61
  jmp __alltraps
  102264:	e9 7c fc ff ff       	jmp    101ee5 <__alltraps>

00102269 <vector98>:
.globl vector98
vector98:
  pushl $0
  102269:	6a 00                	push   $0x0
  pushl $98
  10226b:	6a 62                	push   $0x62
  jmp __alltraps
  10226d:	e9 73 fc ff ff       	jmp    101ee5 <__alltraps>

00102272 <vector99>:
.globl vector99
vector99:
  pushl $0
  102272:	6a 00                	push   $0x0
  pushl $99
  102274:	6a 63                	push   $0x63
  jmp __alltraps
  102276:	e9 6a fc ff ff       	jmp    101ee5 <__alltraps>

0010227b <vector100>:
.globl vector100
vector100:
  pushl $0
  10227b:	6a 00                	push   $0x0
  pushl $100
  10227d:	6a 64                	push   $0x64
  jmp __alltraps
  10227f:	e9 61 fc ff ff       	jmp    101ee5 <__alltraps>

00102284 <vector101>:
.globl vector101
vector101:
  pushl $0
  102284:	6a 00                	push   $0x0
  pushl $101
  102286:	6a 65                	push   $0x65
  jmp __alltraps
  102288:	e9 58 fc ff ff       	jmp    101ee5 <__alltraps>

0010228d <vector102>:
.globl vector102
vector102:
  pushl $0
  10228d:	6a 00                	push   $0x0
  pushl $102
  10228f:	6a 66                	push   $0x66
  jmp __alltraps
  102291:	e9 4f fc ff ff       	jmp    101ee5 <__alltraps>

00102296 <vector103>:
.globl vector103
vector103:
  pushl $0
  102296:	6a 00                	push   $0x0
  pushl $103
  102298:	6a 67                	push   $0x67
  jmp __alltraps
  10229a:	e9 46 fc ff ff       	jmp    101ee5 <__alltraps>

0010229f <vector104>:
.globl vector104
vector104:
  pushl $0
  10229f:	6a 00                	push   $0x0
  pushl $104
  1022a1:	6a 68                	push   $0x68
  jmp __alltraps
  1022a3:	e9 3d fc ff ff       	jmp    101ee5 <__alltraps>

001022a8 <vector105>:
.globl vector105
vector105:
  pushl $0
  1022a8:	6a 00                	push   $0x0
  pushl $105
  1022aa:	6a 69                	push   $0x69
  jmp __alltraps
  1022ac:	e9 34 fc ff ff       	jmp    101ee5 <__alltraps>

001022b1 <vector106>:
.globl vector106
vector106:
  pushl $0
  1022b1:	6a 00                	push   $0x0
  pushl $106
  1022b3:	6a 6a                	push   $0x6a
  jmp __alltraps
  1022b5:	e9 2b fc ff ff       	jmp    101ee5 <__alltraps>

001022ba <vector107>:
.globl vector107
vector107:
  pushl $0
  1022ba:	6a 00                	push   $0x0
  pushl $107
  1022bc:	6a 6b                	push   $0x6b
  jmp __alltraps
  1022be:	e9 22 fc ff ff       	jmp    101ee5 <__alltraps>

001022c3 <vector108>:
.globl vector108
vector108:
  pushl $0
  1022c3:	6a 00                	push   $0x0
  pushl $108
  1022c5:	6a 6c                	push   $0x6c
  jmp __alltraps
  1022c7:	e9 19 fc ff ff       	jmp    101ee5 <__alltraps>

001022cc <vector109>:
.globl vector109
vector109:
  pushl $0
  1022cc:	6a 00                	push   $0x0
  pushl $109
  1022ce:	6a 6d                	push   $0x6d
  jmp __alltraps
  1022d0:	e9 10 fc ff ff       	jmp    101ee5 <__alltraps>

001022d5 <vector110>:
.globl vector110
vector110:
  pushl $0
  1022d5:	6a 00                	push   $0x0
  pushl $110
  1022d7:	6a 6e                	push   $0x6e
  jmp __alltraps
  1022d9:	e9 07 fc ff ff       	jmp    101ee5 <__alltraps>

001022de <vector111>:
.globl vector111
vector111:
  pushl $0
  1022de:	6a 00                	push   $0x0
  pushl $111
  1022e0:	6a 6f                	push   $0x6f
  jmp __alltraps
  1022e2:	e9 fe fb ff ff       	jmp    101ee5 <__alltraps>

001022e7 <vector112>:
.globl vector112
vector112:
  pushl $0
  1022e7:	6a 00                	push   $0x0
  pushl $112
  1022e9:	6a 70                	push   $0x70
  jmp __alltraps
  1022eb:	e9 f5 fb ff ff       	jmp    101ee5 <__alltraps>

001022f0 <vector113>:
.globl vector113
vector113:
  pushl $0
  1022f0:	6a 00                	push   $0x0
  pushl $113
  1022f2:	6a 71                	push   $0x71
  jmp __alltraps
  1022f4:	e9 ec fb ff ff       	jmp    101ee5 <__alltraps>

001022f9 <vector114>:
.globl vector114
vector114:
  pushl $0
  1022f9:	6a 00                	push   $0x0
  pushl $114
  1022fb:	6a 72                	push   $0x72
  jmp __alltraps
  1022fd:	e9 e3 fb ff ff       	jmp    101ee5 <__alltraps>

00102302 <vector115>:
.globl vector115
vector115:
  pushl $0
  102302:	6a 00                	push   $0x0
  pushl $115
  102304:	6a 73                	push   $0x73
  jmp __alltraps
  102306:	e9 da fb ff ff       	jmp    101ee5 <__alltraps>

0010230b <vector116>:
.globl vector116
vector116:
  pushl $0
  10230b:	6a 00                	push   $0x0
  pushl $116
  10230d:	6a 74                	push   $0x74
  jmp __alltraps
  10230f:	e9 d1 fb ff ff       	jmp    101ee5 <__alltraps>

00102314 <vector117>:
.globl vector117
vector117:
  pushl $0
  102314:	6a 00                	push   $0x0
  pushl $117
  102316:	6a 75                	push   $0x75
  jmp __alltraps
  102318:	e9 c8 fb ff ff       	jmp    101ee5 <__alltraps>

0010231d <vector118>:
.globl vector118
vector118:
  pushl $0
  10231d:	6a 00                	push   $0x0
  pushl $118
  10231f:	6a 76                	push   $0x76
  jmp __alltraps
  102321:	e9 bf fb ff ff       	jmp    101ee5 <__alltraps>

00102326 <vector119>:
.globl vector119
vector119:
  pushl $0
  102326:	6a 00                	push   $0x0
  pushl $119
  102328:	6a 77                	push   $0x77
  jmp __alltraps
  10232a:	e9 b6 fb ff ff       	jmp    101ee5 <__alltraps>

0010232f <vector120>:
.globl vector120
vector120:
  pushl $0
  10232f:	6a 00                	push   $0x0
  pushl $120
  102331:	6a 78                	push   $0x78
  jmp __alltraps
  102333:	e9 ad fb ff ff       	jmp    101ee5 <__alltraps>

00102338 <vector121>:
.globl vector121
vector121:
  pushl $0
  102338:	6a 00                	push   $0x0
  pushl $121
  10233a:	6a 79                	push   $0x79
  jmp __alltraps
  10233c:	e9 a4 fb ff ff       	jmp    101ee5 <__alltraps>

00102341 <vector122>:
.globl vector122
vector122:
  pushl $0
  102341:	6a 00                	push   $0x0
  pushl $122
  102343:	6a 7a                	push   $0x7a
  jmp __alltraps
  102345:	e9 9b fb ff ff       	jmp    101ee5 <__alltraps>

0010234a <vector123>:
.globl vector123
vector123:
  pushl $0
  10234a:	6a 00                	push   $0x0
  pushl $123
  10234c:	6a 7b                	push   $0x7b
  jmp __alltraps
  10234e:	e9 92 fb ff ff       	jmp    101ee5 <__alltraps>

00102353 <vector124>:
.globl vector124
vector124:
  pushl $0
  102353:	6a 00                	push   $0x0
  pushl $124
  102355:	6a 7c                	push   $0x7c
  jmp __alltraps
  102357:	e9 89 fb ff ff       	jmp    101ee5 <__alltraps>

0010235c <vector125>:
.globl vector125
vector125:
  pushl $0
  10235c:	6a 00                	push   $0x0
  pushl $125
  10235e:	6a 7d                	push   $0x7d
  jmp __alltraps
  102360:	e9 80 fb ff ff       	jmp    101ee5 <__alltraps>

00102365 <vector126>:
.globl vector126
vector126:
  pushl $0
  102365:	6a 00                	push   $0x0
  pushl $126
  102367:	6a 7e                	push   $0x7e
  jmp __alltraps
  102369:	e9 77 fb ff ff       	jmp    101ee5 <__alltraps>

0010236e <vector127>:
.globl vector127
vector127:
  pushl $0
  10236e:	6a 00                	push   $0x0
  pushl $127
  102370:	6a 7f                	push   $0x7f
  jmp __alltraps
  102372:	e9 6e fb ff ff       	jmp    101ee5 <__alltraps>

00102377 <vector128>:
.globl vector128
vector128:
  pushl $0
  102377:	6a 00                	push   $0x0
  pushl $128
  102379:	68 80 00 00 00       	push   $0x80
  jmp __alltraps
  10237e:	e9 62 fb ff ff       	jmp    101ee5 <__alltraps>

00102383 <vector129>:
.globl vector129
vector129:
  pushl $0
  102383:	6a 00                	push   $0x0
  pushl $129
  102385:	68 81 00 00 00       	push   $0x81
  jmp __alltraps
  10238a:	e9 56 fb ff ff       	jmp    101ee5 <__alltraps>

0010238f <vector130>:
.globl vector130
vector130:
  pushl $0
  10238f:	6a 00                	push   $0x0
  pushl $130
  102391:	68 82 00 00 00       	push   $0x82
  jmp __alltraps
  102396:	e9 4a fb ff ff       	jmp    101ee5 <__alltraps>

0010239b <vector131>:
.globl vector131
vector131:
  pushl $0
  10239b:	6a 00                	push   $0x0
  pushl $131
  10239d:	68 83 00 00 00       	push   $0x83
  jmp __alltraps
  1023a2:	e9 3e fb ff ff       	jmp    101ee5 <__alltraps>

001023a7 <vector132>:
.globl vector132
vector132:
  pushl $0
  1023a7:	6a 00                	push   $0x0
  pushl $132
  1023a9:	68 84 00 00 00       	push   $0x84
  jmp __alltraps
  1023ae:	e9 32 fb ff ff       	jmp    101ee5 <__alltraps>

001023b3 <vector133>:
.globl vector133
vector133:
  pushl $0
  1023b3:	6a 00                	push   $0x0
  pushl $133
  1023b5:	68 85 00 00 00       	push   $0x85
  jmp __alltraps
  1023ba:	e9 26 fb ff ff       	jmp    101ee5 <__alltraps>

001023bf <vector134>:
.globl vector134
vector134:
  pushl $0
  1023bf:	6a 00                	push   $0x0
  pushl $134
  1023c1:	68 86 00 00 00       	push   $0x86
  jmp __alltraps
  1023c6:	e9 1a fb ff ff       	jmp    101ee5 <__alltraps>

001023cb <vector135>:
.globl vector135
vector135:
  pushl $0
  1023cb:	6a 00                	push   $0x0
  pushl $135
  1023cd:	68 87 00 00 00       	push   $0x87
  jmp __alltraps
  1023d2:	e9 0e fb ff ff       	jmp    101ee5 <__alltraps>

001023d7 <vector136>:
.globl vector136
vector136:
  pushl $0
  1023d7:	6a 00                	push   $0x0
  pushl $136
  1023d9:	68 88 00 00 00       	push   $0x88
  jmp __alltraps
  1023de:	e9 02 fb ff ff       	jmp    101ee5 <__alltraps>

001023e3 <vector137>:
.globl vector137
vector137:
  pushl $0
  1023e3:	6a 00                	push   $0x0
  pushl $137
  1023e5:	68 89 00 00 00       	push   $0x89
  jmp __alltraps
  1023ea:	e9 f6 fa ff ff       	jmp    101ee5 <__alltraps>

001023ef <vector138>:
.globl vector138
vector138:
  pushl $0
  1023ef:	6a 00                	push   $0x0
  pushl $138
  1023f1:	68 8a 00 00 00       	push   $0x8a
  jmp __alltraps
  1023f6:	e9 ea fa ff ff       	jmp    101ee5 <__alltraps>

001023fb <vector139>:
.globl vector139
vector139:
  pushl $0
  1023fb:	6a 00                	push   $0x0
  pushl $139
  1023fd:	68 8b 00 00 00       	push   $0x8b
  jmp __alltraps
  102402:	e9 de fa ff ff       	jmp    101ee5 <__alltraps>

00102407 <vector140>:
.globl vector140
vector140:
  pushl $0
  102407:	6a 00                	push   $0x0
  pushl $140
  102409:	68 8c 00 00 00       	push   $0x8c
  jmp __alltraps
  10240e:	e9 d2 fa ff ff       	jmp    101ee5 <__alltraps>

00102413 <vector141>:
.globl vector141
vector141:
  pushl $0
  102413:	6a 00                	push   $0x0
  pushl $141
  102415:	68 8d 00 00 00       	push   $0x8d
  jmp __alltraps
  10241a:	e9 c6 fa ff ff       	jmp    101ee5 <__alltraps>

0010241f <vector142>:
.globl vector142
vector142:
  pushl $0
  10241f:	6a 00                	push   $0x0
  pushl $142
  102421:	68 8e 00 00 00       	push   $0x8e
  jmp __alltraps
  102426:	e9 ba fa ff ff       	jmp    101ee5 <__alltraps>

0010242b <vector143>:
.globl vector143
vector143:
  pushl $0
  10242b:	6a 00                	push   $0x0
  pushl $143
  10242d:	68 8f 00 00 00       	push   $0x8f
  jmp __alltraps
  102432:	e9 ae fa ff ff       	jmp    101ee5 <__alltraps>

00102437 <vector144>:
.globl vector144
vector144:
  pushl $0
  102437:	6a 00                	push   $0x0
  pushl $144
  102439:	68 90 00 00 00       	push   $0x90
  jmp __alltraps
  10243e:	e9 a2 fa ff ff       	jmp    101ee5 <__alltraps>

00102443 <vector145>:
.globl vector145
vector145:
  pushl $0
  102443:	6a 00                	push   $0x0
  pushl $145
  102445:	68 91 00 00 00       	push   $0x91
  jmp __alltraps
  10244a:	e9 96 fa ff ff       	jmp    101ee5 <__alltraps>

0010244f <vector146>:
.globl vector146
vector146:
  pushl $0
  10244f:	6a 00                	push   $0x0
  pushl $146
  102451:	68 92 00 00 00       	push   $0x92
  jmp __alltraps
  102456:	e9 8a fa ff ff       	jmp    101ee5 <__alltraps>

0010245b <vector147>:
.globl vector147
vector147:
  pushl $0
  10245b:	6a 00                	push   $0x0
  pushl $147
  10245d:	68 93 00 00 00       	push   $0x93
  jmp __alltraps
  102462:	e9 7e fa ff ff       	jmp    101ee5 <__alltraps>

00102467 <vector148>:
.globl vector148
vector148:
  pushl $0
  102467:	6a 00                	push   $0x0
  pushl $148
  102469:	68 94 00 00 00       	push   $0x94
  jmp __alltraps
  10246e:	e9 72 fa ff ff       	jmp    101ee5 <__alltraps>

00102473 <vector149>:
.globl vector149
vector149:
  pushl $0
  102473:	6a 00                	push   $0x0
  pushl $149
  102475:	68 95 00 00 00       	push   $0x95
  jmp __alltraps
  10247a:	e9 66 fa ff ff       	jmp    101ee5 <__alltraps>

0010247f <vector150>:
.globl vector150
vector150:
  pushl $0
  10247f:	6a 00                	push   $0x0
  pushl $150
  102481:	68 96 00 00 00       	push   $0x96
  jmp __alltraps
  102486:	e9 5a fa ff ff       	jmp    101ee5 <__alltraps>

0010248b <vector151>:
.globl vector151
vector151:
  pushl $0
  10248b:	6a 00                	push   $0x0
  pushl $151
  10248d:	68 97 00 00 00       	push   $0x97
  jmp __alltraps
  102492:	e9 4e fa ff ff       	jmp    101ee5 <__alltraps>

00102497 <vector152>:
.globl vector152
vector152:
  pushl $0
  102497:	6a 00                	push   $0x0
  pushl $152
  102499:	68 98 00 00 00       	push   $0x98
  jmp __alltraps
  10249e:	e9 42 fa ff ff       	jmp    101ee5 <__alltraps>

001024a3 <vector153>:
.globl vector153
vector153:
  pushl $0
  1024a3:	6a 00                	push   $0x0
  pushl $153
  1024a5:	68 99 00 00 00       	push   $0x99
  jmp __alltraps
  1024aa:	e9 36 fa ff ff       	jmp    101ee5 <__alltraps>

001024af <vector154>:
.globl vector154
vector154:
  pushl $0
  1024af:	6a 00                	push   $0x0
  pushl $154
  1024b1:	68 9a 00 00 00       	push   $0x9a
  jmp __alltraps
  1024b6:	e9 2a fa ff ff       	jmp    101ee5 <__alltraps>

001024bb <vector155>:
.globl vector155
vector155:
  pushl $0
  1024bb:	6a 00                	push   $0x0
  pushl $155
  1024bd:	68 9b 00 00 00       	push   $0x9b
  jmp __alltraps
  1024c2:	e9 1e fa ff ff       	jmp    101ee5 <__alltraps>

001024c7 <vector156>:
.globl vector156
vector156:
  pushl $0
  1024c7:	6a 00                	push   $0x0
  pushl $156
  1024c9:	68 9c 00 00 00       	push   $0x9c
  jmp __alltraps
  1024ce:	e9 12 fa ff ff       	jmp    101ee5 <__alltraps>

001024d3 <vector157>:
.globl vector157
vector157:
  pushl $0
  1024d3:	6a 00                	push   $0x0
  pushl $157
  1024d5:	68 9d 00 00 00       	push   $0x9d
  jmp __alltraps
  1024da:	e9 06 fa ff ff       	jmp    101ee5 <__alltraps>

001024df <vector158>:
.globl vector158
vector158:
  pushl $0
  1024df:	6a 00                	push   $0x0
  pushl $158
  1024e1:	68 9e 00 00 00       	push   $0x9e
  jmp __alltraps
  1024e6:	e9 fa f9 ff ff       	jmp    101ee5 <__alltraps>

001024eb <vector159>:
.globl vector159
vector159:
  pushl $0
  1024eb:	6a 00                	push   $0x0
  pushl $159
  1024ed:	68 9f 00 00 00       	push   $0x9f
  jmp __alltraps
  1024f2:	e9 ee f9 ff ff       	jmp    101ee5 <__alltraps>

001024f7 <vector160>:
.globl vector160
vector160:
  pushl $0
  1024f7:	6a 00                	push   $0x0
  pushl $160
  1024f9:	68 a0 00 00 00       	push   $0xa0
  jmp __alltraps
  1024fe:	e9 e2 f9 ff ff       	jmp    101ee5 <__alltraps>

00102503 <vector161>:
.globl vector161
vector161:
  pushl $0
  102503:	6a 00                	push   $0x0
  pushl $161
  102505:	68 a1 00 00 00       	push   $0xa1
  jmp __alltraps
  10250a:	e9 d6 f9 ff ff       	jmp    101ee5 <__alltraps>

0010250f <vector162>:
.globl vector162
vector162:
  pushl $0
  10250f:	6a 00                	push   $0x0
  pushl $162
  102511:	68 a2 00 00 00       	push   $0xa2
  jmp __alltraps
  102516:	e9 ca f9 ff ff       	jmp    101ee5 <__alltraps>

0010251b <vector163>:
.globl vector163
vector163:
  pushl $0
  10251b:	6a 00                	push   $0x0
  pushl $163
  10251d:	68 a3 00 00 00       	push   $0xa3
  jmp __alltraps
  102522:	e9 be f9 ff ff       	jmp    101ee5 <__alltraps>

00102527 <vector164>:
.globl vector164
vector164:
  pushl $0
  102527:	6a 00                	push   $0x0
  pushl $164
  102529:	68 a4 00 00 00       	push   $0xa4
  jmp __alltraps
  10252e:	e9 b2 f9 ff ff       	jmp    101ee5 <__alltraps>

00102533 <vector165>:
.globl vector165
vector165:
  pushl $0
  102533:	6a 00                	push   $0x0
  pushl $165
  102535:	68 a5 00 00 00       	push   $0xa5
  jmp __alltraps
  10253a:	e9 a6 f9 ff ff       	jmp    101ee5 <__alltraps>

0010253f <vector166>:
.globl vector166
vector166:
  pushl $0
  10253f:	6a 00                	push   $0x0
  pushl $166
  102541:	68 a6 00 00 00       	push   $0xa6
  jmp __alltraps
  102546:	e9 9a f9 ff ff       	jmp    101ee5 <__alltraps>

0010254b <vector167>:
.globl vector167
vector167:
  pushl $0
  10254b:	6a 00                	push   $0x0
  pushl $167
  10254d:	68 a7 00 00 00       	push   $0xa7
  jmp __alltraps
  102552:	e9 8e f9 ff ff       	jmp    101ee5 <__alltraps>

00102557 <vector168>:
.globl vector168
vector168:
  pushl $0
  102557:	6a 00                	push   $0x0
  pushl $168
  102559:	68 a8 00 00 00       	push   $0xa8
  jmp __alltraps
  10255e:	e9 82 f9 ff ff       	jmp    101ee5 <__alltraps>

00102563 <vector169>:
.globl vector169
vector169:
  pushl $0
  102563:	6a 00                	push   $0x0
  pushl $169
  102565:	68 a9 00 00 00       	push   $0xa9
  jmp __alltraps
  10256a:	e9 76 f9 ff ff       	jmp    101ee5 <__alltraps>

0010256f <vector170>:
.globl vector170
vector170:
  pushl $0
  10256f:	6a 00                	push   $0x0
  pushl $170
  102571:	68 aa 00 00 00       	push   $0xaa
  jmp __alltraps
  102576:	e9 6a f9 ff ff       	jmp    101ee5 <__alltraps>

0010257b <vector171>:
.globl vector171
vector171:
  pushl $0
  10257b:	6a 00                	push   $0x0
  pushl $171
  10257d:	68 ab 00 00 00       	push   $0xab
  jmp __alltraps
  102582:	e9 5e f9 ff ff       	jmp    101ee5 <__alltraps>

00102587 <vector172>:
.globl vector172
vector172:
  pushl $0
  102587:	6a 00                	push   $0x0
  pushl $172
  102589:	68 ac 00 00 00       	push   $0xac
  jmp __alltraps
  10258e:	e9 52 f9 ff ff       	jmp    101ee5 <__alltraps>

00102593 <vector173>:
.globl vector173
vector173:
  pushl $0
  102593:	6a 00                	push   $0x0
  pushl $173
  102595:	68 ad 00 00 00       	push   $0xad
  jmp __alltraps
  10259a:	e9 46 f9 ff ff       	jmp    101ee5 <__alltraps>

0010259f <vector174>:
.globl vector174
vector174:
  pushl $0
  10259f:	6a 00                	push   $0x0
  pushl $174
  1025a1:	68 ae 00 00 00       	push   $0xae
  jmp __alltraps
  1025a6:	e9 3a f9 ff ff       	jmp    101ee5 <__alltraps>

001025ab <vector175>:
.globl vector175
vector175:
  pushl $0
  1025ab:	6a 00                	push   $0x0
  pushl $175
  1025ad:	68 af 00 00 00       	push   $0xaf
  jmp __alltraps
  1025b2:	e9 2e f9 ff ff       	jmp    101ee5 <__alltraps>

001025b7 <vector176>:
.globl vector176
vector176:
  pushl $0
  1025b7:	6a 00                	push   $0x0
  pushl $176
  1025b9:	68 b0 00 00 00       	push   $0xb0
  jmp __alltraps
  1025be:	e9 22 f9 ff ff       	jmp    101ee5 <__alltraps>

001025c3 <vector177>:
.globl vector177
vector177:
  pushl $0
  1025c3:	6a 00                	push   $0x0
  pushl $177
  1025c5:	68 b1 00 00 00       	push   $0xb1
  jmp __alltraps
  1025ca:	e9 16 f9 ff ff       	jmp    101ee5 <__alltraps>

001025cf <vector178>:
.globl vector178
vector178:
  pushl $0
  1025cf:	6a 00                	push   $0x0
  pushl $178
  1025d1:	68 b2 00 00 00       	push   $0xb2
  jmp __alltraps
  1025d6:	e9 0a f9 ff ff       	jmp    101ee5 <__alltraps>

001025db <vector179>:
.globl vector179
vector179:
  pushl $0
  1025db:	6a 00                	push   $0x0
  pushl $179
  1025dd:	68 b3 00 00 00       	push   $0xb3
  jmp __alltraps
  1025e2:	e9 fe f8 ff ff       	jmp    101ee5 <__alltraps>

001025e7 <vector180>:
.globl vector180
vector180:
  pushl $0
  1025e7:	6a 00                	push   $0x0
  pushl $180
  1025e9:	68 b4 00 00 00       	push   $0xb4
  jmp __alltraps
  1025ee:	e9 f2 f8 ff ff       	jmp    101ee5 <__alltraps>

001025f3 <vector181>:
.globl vector181
vector181:
  pushl $0
  1025f3:	6a 00                	push   $0x0
  pushl $181
  1025f5:	68 b5 00 00 00       	push   $0xb5
  jmp __alltraps
  1025fa:	e9 e6 f8 ff ff       	jmp    101ee5 <__alltraps>

001025ff <vector182>:
.globl vector182
vector182:
  pushl $0
  1025ff:	6a 00                	push   $0x0
  pushl $182
  102601:	68 b6 00 00 00       	push   $0xb6
  jmp __alltraps
  102606:	e9 da f8 ff ff       	jmp    101ee5 <__alltraps>

0010260b <vector183>:
.globl vector183
vector183:
  pushl $0
  10260b:	6a 00                	push   $0x0
  pushl $183
  10260d:	68 b7 00 00 00       	push   $0xb7
  jmp __alltraps
  102612:	e9 ce f8 ff ff       	jmp    101ee5 <__alltraps>

00102617 <vector184>:
.globl vector184
vector184:
  pushl $0
  102617:	6a 00                	push   $0x0
  pushl $184
  102619:	68 b8 00 00 00       	push   $0xb8
  jmp __alltraps
  10261e:	e9 c2 f8 ff ff       	jmp    101ee5 <__alltraps>

00102623 <vector185>:
.globl vector185
vector185:
  pushl $0
  102623:	6a 00                	push   $0x0
  pushl $185
  102625:	68 b9 00 00 00       	push   $0xb9
  jmp __alltraps
  10262a:	e9 b6 f8 ff ff       	jmp    101ee5 <__alltraps>

0010262f <vector186>:
.globl vector186
vector186:
  pushl $0
  10262f:	6a 00                	push   $0x0
  pushl $186
  102631:	68 ba 00 00 00       	push   $0xba
  jmp __alltraps
  102636:	e9 aa f8 ff ff       	jmp    101ee5 <__alltraps>

0010263b <vector187>:
.globl vector187
vector187:
  pushl $0
  10263b:	6a 00                	push   $0x0
  pushl $187
  10263d:	68 bb 00 00 00       	push   $0xbb
  jmp __alltraps
  102642:	e9 9e f8 ff ff       	jmp    101ee5 <__alltraps>

00102647 <vector188>:
.globl vector188
vector188:
  pushl $0
  102647:	6a 00                	push   $0x0
  pushl $188
  102649:	68 bc 00 00 00       	push   $0xbc
  jmp __alltraps
  10264e:	e9 92 f8 ff ff       	jmp    101ee5 <__alltraps>

00102653 <vector189>:
.globl vector189
vector189:
  pushl $0
  102653:	6a 00                	push   $0x0
  pushl $189
  102655:	68 bd 00 00 00       	push   $0xbd
  jmp __alltraps
  10265a:	e9 86 f8 ff ff       	jmp    101ee5 <__alltraps>

0010265f <vector190>:
.globl vector190
vector190:
  pushl $0
  10265f:	6a 00                	push   $0x0
  pushl $190
  102661:	68 be 00 00 00       	push   $0xbe
  jmp __alltraps
  102666:	e9 7a f8 ff ff       	jmp    101ee5 <__alltraps>

0010266b <vector191>:
.globl vector191
vector191:
  pushl $0
  10266b:	6a 00                	push   $0x0
  pushl $191
  10266d:	68 bf 00 00 00       	push   $0xbf
  jmp __alltraps
  102672:	e9 6e f8 ff ff       	jmp    101ee5 <__alltraps>

00102677 <vector192>:
.globl vector192
vector192:
  pushl $0
  102677:	6a 00                	push   $0x0
  pushl $192
  102679:	68 c0 00 00 00       	push   $0xc0
  jmp __alltraps
  10267e:	e9 62 f8 ff ff       	jmp    101ee5 <__alltraps>

00102683 <vector193>:
.globl vector193
vector193:
  pushl $0
  102683:	6a 00                	push   $0x0
  pushl $193
  102685:	68 c1 00 00 00       	push   $0xc1
  jmp __alltraps
  10268a:	e9 56 f8 ff ff       	jmp    101ee5 <__alltraps>

0010268f <vector194>:
.globl vector194
vector194:
  pushl $0
  10268f:	6a 00                	push   $0x0
  pushl $194
  102691:	68 c2 00 00 00       	push   $0xc2
  jmp __alltraps
  102696:	e9 4a f8 ff ff       	jmp    101ee5 <__alltraps>

0010269b <vector195>:
.globl vector195
vector195:
  pushl $0
  10269b:	6a 00                	push   $0x0
  pushl $195
  10269d:	68 c3 00 00 00       	push   $0xc3
  jmp __alltraps
  1026a2:	e9 3e f8 ff ff       	jmp    101ee5 <__alltraps>

001026a7 <vector196>:
.globl vector196
vector196:
  pushl $0
  1026a7:	6a 00                	push   $0x0
  pushl $196
  1026a9:	68 c4 00 00 00       	push   $0xc4
  jmp __alltraps
  1026ae:	e9 32 f8 ff ff       	jmp    101ee5 <__alltraps>

001026b3 <vector197>:
.globl vector197
vector197:
  pushl $0
  1026b3:	6a 00                	push   $0x0
  pushl $197
  1026b5:	68 c5 00 00 00       	push   $0xc5
  jmp __alltraps
  1026ba:	e9 26 f8 ff ff       	jmp    101ee5 <__alltraps>

001026bf <vector198>:
.globl vector198
vector198:
  pushl $0
  1026bf:	6a 00                	push   $0x0
  pushl $198
  1026c1:	68 c6 00 00 00       	push   $0xc6
  jmp __alltraps
  1026c6:	e9 1a f8 ff ff       	jmp    101ee5 <__alltraps>

001026cb <vector199>:
.globl vector199
vector199:
  pushl $0
  1026cb:	6a 00                	push   $0x0
  pushl $199
  1026cd:	68 c7 00 00 00       	push   $0xc7
  jmp __alltraps
  1026d2:	e9 0e f8 ff ff       	jmp    101ee5 <__alltraps>

001026d7 <vector200>:
.globl vector200
vector200:
  pushl $0
  1026d7:	6a 00                	push   $0x0
  pushl $200
  1026d9:	68 c8 00 00 00       	push   $0xc8
  jmp __alltraps
  1026de:	e9 02 f8 ff ff       	jmp    101ee5 <__alltraps>

001026e3 <vector201>:
.globl vector201
vector201:
  pushl $0
  1026e3:	6a 00                	push   $0x0
  pushl $201
  1026e5:	68 c9 00 00 00       	push   $0xc9
  jmp __alltraps
  1026ea:	e9 f6 f7 ff ff       	jmp    101ee5 <__alltraps>

001026ef <vector202>:
.globl vector202
vector202:
  pushl $0
  1026ef:	6a 00                	push   $0x0
  pushl $202
  1026f1:	68 ca 00 00 00       	push   $0xca
  jmp __alltraps
  1026f6:	e9 ea f7 ff ff       	jmp    101ee5 <__alltraps>

001026fb <vector203>:
.globl vector203
vector203:
  pushl $0
  1026fb:	6a 00                	push   $0x0
  pushl $203
  1026fd:	68 cb 00 00 00       	push   $0xcb
  jmp __alltraps
  102702:	e9 de f7 ff ff       	jmp    101ee5 <__alltraps>

00102707 <vector204>:
.globl vector204
vector204:
  pushl $0
  102707:	6a 00                	push   $0x0
  pushl $204
  102709:	68 cc 00 00 00       	push   $0xcc
  jmp __alltraps
  10270e:	e9 d2 f7 ff ff       	jmp    101ee5 <__alltraps>

00102713 <vector205>:
.globl vector205
vector205:
  pushl $0
  102713:	6a 00                	push   $0x0
  pushl $205
  102715:	68 cd 00 00 00       	push   $0xcd
  jmp __alltraps
  10271a:	e9 c6 f7 ff ff       	jmp    101ee5 <__alltraps>

0010271f <vector206>:
.globl vector206
vector206:
  pushl $0
  10271f:	6a 00                	push   $0x0
  pushl $206
  102721:	68 ce 00 00 00       	push   $0xce
  jmp __alltraps
  102726:	e9 ba f7 ff ff       	jmp    101ee5 <__alltraps>

0010272b <vector207>:
.globl vector207
vector207:
  pushl $0
  10272b:	6a 00                	push   $0x0
  pushl $207
  10272d:	68 cf 00 00 00       	push   $0xcf
  jmp __alltraps
  102732:	e9 ae f7 ff ff       	jmp    101ee5 <__alltraps>

00102737 <vector208>:
.globl vector208
vector208:
  pushl $0
  102737:	6a 00                	push   $0x0
  pushl $208
  102739:	68 d0 00 00 00       	push   $0xd0
  jmp __alltraps
  10273e:	e9 a2 f7 ff ff       	jmp    101ee5 <__alltraps>

00102743 <vector209>:
.globl vector209
vector209:
  pushl $0
  102743:	6a 00                	push   $0x0
  pushl $209
  102745:	68 d1 00 00 00       	push   $0xd1
  jmp __alltraps
  10274a:	e9 96 f7 ff ff       	jmp    101ee5 <__alltraps>

0010274f <vector210>:
.globl vector210
vector210:
  pushl $0
  10274f:	6a 00                	push   $0x0
  pushl $210
  102751:	68 d2 00 00 00       	push   $0xd2
  jmp __alltraps
  102756:	e9 8a f7 ff ff       	jmp    101ee5 <__alltraps>

0010275b <vector211>:
.globl vector211
vector211:
  pushl $0
  10275b:	6a 00                	push   $0x0
  pushl $211
  10275d:	68 d3 00 00 00       	push   $0xd3
  jmp __alltraps
  102762:	e9 7e f7 ff ff       	jmp    101ee5 <__alltraps>

00102767 <vector212>:
.globl vector212
vector212:
  pushl $0
  102767:	6a 00                	push   $0x0
  pushl $212
  102769:	68 d4 00 00 00       	push   $0xd4
  jmp __alltraps
  10276e:	e9 72 f7 ff ff       	jmp    101ee5 <__alltraps>

00102773 <vector213>:
.globl vector213
vector213:
  pushl $0
  102773:	6a 00                	push   $0x0
  pushl $213
  102775:	68 d5 00 00 00       	push   $0xd5
  jmp __alltraps
  10277a:	e9 66 f7 ff ff       	jmp    101ee5 <__alltraps>

0010277f <vector214>:
.globl vector214
vector214:
  pushl $0
  10277f:	6a 00                	push   $0x0
  pushl $214
  102781:	68 d6 00 00 00       	push   $0xd6
  jmp __alltraps
  102786:	e9 5a f7 ff ff       	jmp    101ee5 <__alltraps>

0010278b <vector215>:
.globl vector215
vector215:
  pushl $0
  10278b:	6a 00                	push   $0x0
  pushl $215
  10278d:	68 d7 00 00 00       	push   $0xd7
  jmp __alltraps
  102792:	e9 4e f7 ff ff       	jmp    101ee5 <__alltraps>

00102797 <vector216>:
.globl vector216
vector216:
  pushl $0
  102797:	6a 00                	push   $0x0
  pushl $216
  102799:	68 d8 00 00 00       	push   $0xd8
  jmp __alltraps
  10279e:	e9 42 f7 ff ff       	jmp    101ee5 <__alltraps>

001027a3 <vector217>:
.globl vector217
vector217:
  pushl $0
  1027a3:	6a 00                	push   $0x0
  pushl $217
  1027a5:	68 d9 00 00 00       	push   $0xd9
  jmp __alltraps
  1027aa:	e9 36 f7 ff ff       	jmp    101ee5 <__alltraps>

001027af <vector218>:
.globl vector218
vector218:
  pushl $0
  1027af:	6a 00                	push   $0x0
  pushl $218
  1027b1:	68 da 00 00 00       	push   $0xda
  jmp __alltraps
  1027b6:	e9 2a f7 ff ff       	jmp    101ee5 <__alltraps>

001027bb <vector219>:
.globl vector219
vector219:
  pushl $0
  1027bb:	6a 00                	push   $0x0
  pushl $219
  1027bd:	68 db 00 00 00       	push   $0xdb
  jmp __alltraps
  1027c2:	e9 1e f7 ff ff       	jmp    101ee5 <__alltraps>

001027c7 <vector220>:
.globl vector220
vector220:
  pushl $0
  1027c7:	6a 00                	push   $0x0
  pushl $220
  1027c9:	68 dc 00 00 00       	push   $0xdc
  jmp __alltraps
  1027ce:	e9 12 f7 ff ff       	jmp    101ee5 <__alltraps>

001027d3 <vector221>:
.globl vector221
vector221:
  pushl $0
  1027d3:	6a 00                	push   $0x0
  pushl $221
  1027d5:	68 dd 00 00 00       	push   $0xdd
  jmp __alltraps
  1027da:	e9 06 f7 ff ff       	jmp    101ee5 <__alltraps>

001027df <vector222>:
.globl vector222
vector222:
  pushl $0
  1027df:	6a 00                	push   $0x0
  pushl $222
  1027e1:	68 de 00 00 00       	push   $0xde
  jmp __alltraps
  1027e6:	e9 fa f6 ff ff       	jmp    101ee5 <__alltraps>

001027eb <vector223>:
.globl vector223
vector223:
  pushl $0
  1027eb:	6a 00                	push   $0x0
  pushl $223
  1027ed:	68 df 00 00 00       	push   $0xdf
  jmp __alltraps
  1027f2:	e9 ee f6 ff ff       	jmp    101ee5 <__alltraps>

001027f7 <vector224>:
.globl vector224
vector224:
  pushl $0
  1027f7:	6a 00                	push   $0x0
  pushl $224
  1027f9:	68 e0 00 00 00       	push   $0xe0
  jmp __alltraps
  1027fe:	e9 e2 f6 ff ff       	jmp    101ee5 <__alltraps>

00102803 <vector225>:
.globl vector225
vector225:
  pushl $0
  102803:	6a 00                	push   $0x0
  pushl $225
  102805:	68 e1 00 00 00       	push   $0xe1
  jmp __alltraps
  10280a:	e9 d6 f6 ff ff       	jmp    101ee5 <__alltraps>

0010280f <vector226>:
.globl vector226
vector226:
  pushl $0
  10280f:	6a 00                	push   $0x0
  pushl $226
  102811:	68 e2 00 00 00       	push   $0xe2
  jmp __alltraps
  102816:	e9 ca f6 ff ff       	jmp    101ee5 <__alltraps>

0010281b <vector227>:
.globl vector227
vector227:
  pushl $0
  10281b:	6a 00                	push   $0x0
  pushl $227
  10281d:	68 e3 00 00 00       	push   $0xe3
  jmp __alltraps
  102822:	e9 be f6 ff ff       	jmp    101ee5 <__alltraps>

00102827 <vector228>:
.globl vector228
vector228:
  pushl $0
  102827:	6a 00                	push   $0x0
  pushl $228
  102829:	68 e4 00 00 00       	push   $0xe4
  jmp __alltraps
  10282e:	e9 b2 f6 ff ff       	jmp    101ee5 <__alltraps>

00102833 <vector229>:
.globl vector229
vector229:
  pushl $0
  102833:	6a 00                	push   $0x0
  pushl $229
  102835:	68 e5 00 00 00       	push   $0xe5
  jmp __alltraps
  10283a:	e9 a6 f6 ff ff       	jmp    101ee5 <__alltraps>

0010283f <vector230>:
.globl vector230
vector230:
  pushl $0
  10283f:	6a 00                	push   $0x0
  pushl $230
  102841:	68 e6 00 00 00       	push   $0xe6
  jmp __alltraps
  102846:	e9 9a f6 ff ff       	jmp    101ee5 <__alltraps>

0010284b <vector231>:
.globl vector231
vector231:
  pushl $0
  10284b:	6a 00                	push   $0x0
  pushl $231
  10284d:	68 e7 00 00 00       	push   $0xe7
  jmp __alltraps
  102852:	e9 8e f6 ff ff       	jmp    101ee5 <__alltraps>

00102857 <vector232>:
.globl vector232
vector232:
  pushl $0
  102857:	6a 00                	push   $0x0
  pushl $232
  102859:	68 e8 00 00 00       	push   $0xe8
  jmp __alltraps
  10285e:	e9 82 f6 ff ff       	jmp    101ee5 <__alltraps>

00102863 <vector233>:
.globl vector233
vector233:
  pushl $0
  102863:	6a 00                	push   $0x0
  pushl $233
  102865:	68 e9 00 00 00       	push   $0xe9
  jmp __alltraps
  10286a:	e9 76 f6 ff ff       	jmp    101ee5 <__alltraps>

0010286f <vector234>:
.globl vector234
vector234:
  pushl $0
  10286f:	6a 00                	push   $0x0
  pushl $234
  102871:	68 ea 00 00 00       	push   $0xea
  jmp __alltraps
  102876:	e9 6a f6 ff ff       	jmp    101ee5 <__alltraps>

0010287b <vector235>:
.globl vector235
vector235:
  pushl $0
  10287b:	6a 00                	push   $0x0
  pushl $235
  10287d:	68 eb 00 00 00       	push   $0xeb
  jmp __alltraps
  102882:	e9 5e f6 ff ff       	jmp    101ee5 <__alltraps>

00102887 <vector236>:
.globl vector236
vector236:
  pushl $0
  102887:	6a 00                	push   $0x0
  pushl $236
  102889:	68 ec 00 00 00       	push   $0xec
  jmp __alltraps
  10288e:	e9 52 f6 ff ff       	jmp    101ee5 <__alltraps>

00102893 <vector237>:
.globl vector237
vector237:
  pushl $0
  102893:	6a 00                	push   $0x0
  pushl $237
  102895:	68 ed 00 00 00       	push   $0xed
  jmp __alltraps
  10289a:	e9 46 f6 ff ff       	jmp    101ee5 <__alltraps>

0010289f <vector238>:
.globl vector238
vector238:
  pushl $0
  10289f:	6a 00                	push   $0x0
  pushl $238
  1028a1:	68 ee 00 00 00       	push   $0xee
  jmp __alltraps
  1028a6:	e9 3a f6 ff ff       	jmp    101ee5 <__alltraps>

001028ab <vector239>:
.globl vector239
vector239:
  pushl $0
  1028ab:	6a 00                	push   $0x0
  pushl $239
  1028ad:	68 ef 00 00 00       	push   $0xef
  jmp __alltraps
  1028b2:	e9 2e f6 ff ff       	jmp    101ee5 <__alltraps>

001028b7 <vector240>:
.globl vector240
vector240:
  pushl $0
  1028b7:	6a 00                	push   $0x0
  pushl $240
  1028b9:	68 f0 00 00 00       	push   $0xf0
  jmp __alltraps
  1028be:	e9 22 f6 ff ff       	jmp    101ee5 <__alltraps>

001028c3 <vector241>:
.globl vector241
vector241:
  pushl $0
  1028c3:	6a 00                	push   $0x0
  pushl $241
  1028c5:	68 f1 00 00 00       	push   $0xf1
  jmp __alltraps
  1028ca:	e9 16 f6 ff ff       	jmp    101ee5 <__alltraps>

001028cf <vector242>:
.globl vector242
vector242:
  pushl $0
  1028cf:	6a 00                	push   $0x0
  pushl $242
  1028d1:	68 f2 00 00 00       	push   $0xf2
  jmp __alltraps
  1028d6:	e9 0a f6 ff ff       	jmp    101ee5 <__alltraps>

001028db <vector243>:
.globl vector243
vector243:
  pushl $0
  1028db:	6a 00                	push   $0x0
  pushl $243
  1028dd:	68 f3 00 00 00       	push   $0xf3
  jmp __alltraps
  1028e2:	e9 fe f5 ff ff       	jmp    101ee5 <__alltraps>

001028e7 <vector244>:
.globl vector244
vector244:
  pushl $0
  1028e7:	6a 00                	push   $0x0
  pushl $244
  1028e9:	68 f4 00 00 00       	push   $0xf4
  jmp __alltraps
  1028ee:	e9 f2 f5 ff ff       	jmp    101ee5 <__alltraps>

001028f3 <vector245>:
.globl vector245
vector245:
  pushl $0
  1028f3:	6a 00                	push   $0x0
  pushl $245
  1028f5:	68 f5 00 00 00       	push   $0xf5
  jmp __alltraps
  1028fa:	e9 e6 f5 ff ff       	jmp    101ee5 <__alltraps>

001028ff <vector246>:
.globl vector246
vector246:
  pushl $0
  1028ff:	6a 00                	push   $0x0
  pushl $246
  102901:	68 f6 00 00 00       	push   $0xf6
  jmp __alltraps
  102906:	e9 da f5 ff ff       	jmp    101ee5 <__alltraps>

0010290b <vector247>:
.globl vector247
vector247:
  pushl $0
  10290b:	6a 00                	push   $0x0
  pushl $247
  10290d:	68 f7 00 00 00       	push   $0xf7
  jmp __alltraps
  102912:	e9 ce f5 ff ff       	jmp    101ee5 <__alltraps>

00102917 <vector248>:
.globl vector248
vector248:
  pushl $0
  102917:	6a 00                	push   $0x0
  pushl $248
  102919:	68 f8 00 00 00       	push   $0xf8
  jmp __alltraps
  10291e:	e9 c2 f5 ff ff       	jmp    101ee5 <__alltraps>

00102923 <vector249>:
.globl vector249
vector249:
  pushl $0
  102923:	6a 00                	push   $0x0
  pushl $249
  102925:	68 f9 00 00 00       	push   $0xf9
  jmp __alltraps
  10292a:	e9 b6 f5 ff ff       	jmp    101ee5 <__alltraps>

0010292f <vector250>:
.globl vector250
vector250:
  pushl $0
  10292f:	6a 00                	push   $0x0
  pushl $250
  102931:	68 fa 00 00 00       	push   $0xfa
  jmp __alltraps
  102936:	e9 aa f5 ff ff       	jmp    101ee5 <__alltraps>

0010293b <vector251>:
.globl vector251
vector251:
  pushl $0
  10293b:	6a 00                	push   $0x0
  pushl $251
  10293d:	68 fb 00 00 00       	push   $0xfb
  jmp __alltraps
  102942:	e9 9e f5 ff ff       	jmp    101ee5 <__alltraps>

00102947 <vector252>:
.globl vector252
vector252:
  pushl $0
  102947:	6a 00                	push   $0x0
  pushl $252
  102949:	68 fc 00 00 00       	push   $0xfc
  jmp __alltraps
  10294e:	e9 92 f5 ff ff       	jmp    101ee5 <__alltraps>

00102953 <vector253>:
.globl vector253
vector253:
  pushl $0
  102953:	6a 00                	push   $0x0
  pushl $253
  102955:	68 fd 00 00 00       	push   $0xfd
  jmp __alltraps
  10295a:	e9 86 f5 ff ff       	jmp    101ee5 <__alltraps>

0010295f <vector254>:
.globl vector254
vector254:
  pushl $0
  10295f:	6a 00                	push   $0x0
  pushl $254
  102961:	68 fe 00 00 00       	push   $0xfe
  jmp __alltraps
  102966:	e9 7a f5 ff ff       	jmp    101ee5 <__alltraps>

0010296b <vector255>:
.globl vector255
vector255:
  pushl $0
  10296b:	6a 00                	push   $0x0
  pushl $255
  10296d:	68 ff 00 00 00       	push   $0xff
  jmp __alltraps
  102972:	e9 6e f5 ff ff       	jmp    101ee5 <__alltraps>

00102977 <page2ppn>:

extern struct Page *pages;
extern size_t npage;

static inline ppn_t
page2ppn(struct Page *page) {
  102977:	55                   	push   %ebp
  102978:	89 e5                	mov    %esp,%ebp
    return page - pages;
  10297a:	8b 55 08             	mov    0x8(%ebp),%edx
  10297d:	a1 c4 89 11 00       	mov    0x1189c4,%eax
  102982:	29 c2                	sub    %eax,%edx
  102984:	89 d0                	mov    %edx,%eax
  102986:	c1 f8 02             	sar    $0x2,%eax
  102989:	69 c0 cd cc cc cc    	imul   $0xcccccccd,%eax,%eax
}
  10298f:	5d                   	pop    %ebp
  102990:	c3                   	ret    

00102991 <page2pa>:

static inline uintptr_t
page2pa(struct Page *page) {
  102991:	55                   	push   %ebp
  102992:	89 e5                	mov    %esp,%ebp
  102994:	83 ec 04             	sub    $0x4,%esp
    return page2ppn(page) << PGSHIFT;
  102997:	8b 45 08             	mov    0x8(%ebp),%eax
  10299a:	89 04 24             	mov    %eax,(%esp)
  10299d:	e8 d5 ff ff ff       	call   102977 <page2ppn>
  1029a2:	c1 e0 0c             	shl    $0xc,%eax
}
  1029a5:	c9                   	leave  
  1029a6:	c3                   	ret    

001029a7 <page_ref>:
pde2page(pde_t pde) {
    return pa2page(PDE_ADDR(pde));
}

static inline int
page_ref(struct Page *page) {
  1029a7:	55                   	push   %ebp
  1029a8:	89 e5                	mov    %esp,%ebp
    return page->ref;
  1029aa:	8b 45 08             	mov    0x8(%ebp),%eax
  1029ad:	8b 00                	mov    (%eax),%eax
}
  1029af:	5d                   	pop    %ebp
  1029b0:	c3                   	ret    

001029b1 <set_page_ref>:

static inline void
set_page_ref(struct Page *page, int val) {
  1029b1:	55                   	push   %ebp
  1029b2:	89 e5                	mov    %esp,%ebp
    page->ref = val;
  1029b4:	8b 45 08             	mov    0x8(%ebp),%eax
  1029b7:	8b 55 0c             	mov    0xc(%ebp),%edx
  1029ba:	89 10                	mov    %edx,(%eax)
}
  1029bc:	5d                   	pop    %ebp
  1029bd:	c3                   	ret    

001029be <default_init>:

#define free_list (free_area.free_list)
#define nr_free (free_area.nr_free)

static void
default_init(void) {
  1029be:	55                   	push   %ebp
  1029bf:	89 e5                	mov    %esp,%ebp
  1029c1:	83 ec 10             	sub    $0x10,%esp
  1029c4:	c7 45 fc b0 89 11 00 	movl   $0x1189b0,-0x4(%ebp)
 * list_init - initialize a new entry
 * @elm:        new entry to be initialized
 * */
static inline void
list_init(list_entry_t *elm) {
    elm->prev = elm->next = elm;
  1029cb:	8b 45 fc             	mov    -0x4(%ebp),%eax
  1029ce:	8b 55 fc             	mov    -0x4(%ebp),%edx
  1029d1:	89 50 04             	mov    %edx,0x4(%eax)
  1029d4:	8b 45 fc             	mov    -0x4(%ebp),%eax
  1029d7:	8b 50 04             	mov    0x4(%eax),%edx
  1029da:	8b 45 fc             	mov    -0x4(%ebp),%eax
  1029dd:	89 10                	mov    %edx,(%eax)
    list_init(&free_list);
    nr_free = 0;
  1029df:	c7 05 b8 89 11 00 00 	movl   $0x0,0x1189b8
  1029e6:	00 00 00 
}
  1029e9:	c9                   	leave  
  1029ea:	c3                   	ret    

001029eb <default_init_memmap>:

static void
default_init_memmap(struct Page *base, size_t n) {
  1029eb:	55                   	push   %ebp
  1029ec:	89 e5                	mov    %esp,%ebp
  1029ee:	83 ec 48             	sub    $0x48,%esp
    assert(n > 0);
  1029f1:	83 7d 0c 00          	cmpl   $0x0,0xc(%ebp)
  1029f5:	75 24                	jne    102a1b <default_init_memmap+0x30>
  1029f7:	c7 44 24 0c 50 67 10 	movl   $0x106750,0xc(%esp)
  1029fe:	00 
  1029ff:	c7 44 24 08 56 67 10 	movl   $0x106756,0x8(%esp)
  102a06:	00 
  102a07:	c7 44 24 04 46 00 00 	movl   $0x46,0x4(%esp)
  102a0e:	00 
  102a0f:	c7 04 24 6b 67 10 00 	movl   $0x10676b,(%esp)
  102a16:	e8 ab e2 ff ff       	call   100cc6 <__panic>
    struct Page *p = base;
  102a1b:	8b 45 08             	mov    0x8(%ebp),%eax
  102a1e:	89 45 f4             	mov    %eax,-0xc(%ebp)
    for (; p != base + n; p ++) {
  102a21:	e9 dc 00 00 00       	jmp    102b02 <default_init_memmap+0x117>
        assert(PageReserved(p));
  102a26:	8b 45 f4             	mov    -0xc(%ebp),%eax
  102a29:	83 c0 04             	add    $0x4,%eax
  102a2c:	c7 45 f0 00 00 00 00 	movl   $0x0,-0x10(%ebp)
  102a33:	89 45 ec             	mov    %eax,-0x14(%ebp)
 * @addr:   the address to count from
 * */
static inline bool
test_bit(int nr, volatile void *addr) {
    int oldbit;
    asm volatile ("btl %2, %1; sbbl %0,%0" : "=r" (oldbit) : "m" (*(volatile long *)addr), "Ir" (nr));
  102a36:	8b 45 ec             	mov    -0x14(%ebp),%eax
  102a39:	8b 55 f0             	mov    -0x10(%ebp),%edx
  102a3c:	0f a3 10             	bt     %edx,(%eax)
  102a3f:	19 c0                	sbb    %eax,%eax
  102a41:	89 45 e8             	mov    %eax,-0x18(%ebp)
    return oldbit != 0;
  102a44:	83 7d e8 00          	cmpl   $0x0,-0x18(%ebp)
  102a48:	0f 95 c0             	setne  %al
  102a4b:	0f b6 c0             	movzbl %al,%eax
  102a4e:	85 c0                	test   %eax,%eax
  102a50:	75 24                	jne    102a76 <default_init_memmap+0x8b>
  102a52:	c7 44 24 0c 81 67 10 	movl   $0x106781,0xc(%esp)
  102a59:	00 
  102a5a:	c7 44 24 08 56 67 10 	movl   $0x106756,0x8(%esp)
  102a61:	00 
  102a62:	c7 44 24 04 49 00 00 	movl   $0x49,0x4(%esp)
  102a69:	00 
  102a6a:	c7 04 24 6b 67 10 00 	movl   $0x10676b,(%esp)
  102a71:	e8 50 e2 ff ff       	call   100cc6 <__panic>
        p->flags = 0;
  102a76:	8b 45 f4             	mov    -0xc(%ebp),%eax
  102a79:	c7 40 04 00 00 00 00 	movl   $0x0,0x4(%eax)
        SetPageProperty(p);
  102a80:	8b 45 f4             	mov    -0xc(%ebp),%eax
  102a83:	83 c0 04             	add    $0x4,%eax
  102a86:	c7 45 e4 01 00 00 00 	movl   $0x1,-0x1c(%ebp)
  102a8d:	89 45 e0             	mov    %eax,-0x20(%ebp)
 * Note that @nr may be almost arbitrarily large; this function is not
 * restricted to acting on a single-word quantity.
 * */
static inline void
set_bit(int nr, volatile void *addr) {
    asm volatile ("btsl %1, %0" :"=m" (*(volatile long *)addr) : "Ir" (nr));
  102a90:	8b 45 e0             	mov    -0x20(%ebp),%eax
  102a93:	8b 55 e4             	mov    -0x1c(%ebp),%edx
  102a96:	0f ab 10             	bts    %edx,(%eax)
        p->property = 0;
  102a99:	8b 45 f4             	mov    -0xc(%ebp),%eax
  102a9c:	c7 40 08 00 00 00 00 	movl   $0x0,0x8(%eax)
        set_page_ref(p, 0);
  102aa3:	c7 44 24 04 00 00 00 	movl   $0x0,0x4(%esp)
  102aaa:	00 
  102aab:	8b 45 f4             	mov    -0xc(%ebp),%eax
  102aae:	89 04 24             	mov    %eax,(%esp)
  102ab1:	e8 fb fe ff ff       	call   1029b1 <set_page_ref>
        list_add_before(&free_list, &(p->page_link));
  102ab6:	8b 45 f4             	mov    -0xc(%ebp),%eax
  102ab9:	83 c0 0c             	add    $0xc,%eax
  102abc:	c7 45 dc b0 89 11 00 	movl   $0x1189b0,-0x24(%ebp)
  102ac3:	89 45 d8             	mov    %eax,-0x28(%ebp)
 * Insert the new element @elm *before* the element @listelm which
 * is already in the list.
 * */
static inline void
list_add_before(list_entry_t *listelm, list_entry_t *elm) {
    __list_add(elm, listelm->prev, listelm);
  102ac6:	8b 45 dc             	mov    -0x24(%ebp),%eax
  102ac9:	8b 00                	mov    (%eax),%eax
  102acb:	8b 55 d8             	mov    -0x28(%ebp),%edx
  102ace:	89 55 d4             	mov    %edx,-0x2c(%ebp)
  102ad1:	89 45 d0             	mov    %eax,-0x30(%ebp)
  102ad4:	8b 45 dc             	mov    -0x24(%ebp),%eax
  102ad7:	89 45 cc             	mov    %eax,-0x34(%ebp)
 * This is only for internal list manipulation where we know
 * the prev/next entries already!
 * */
static inline void
__list_add(list_entry_t *elm, list_entry_t *prev, list_entry_t *next) {
    prev->next = next->prev = elm;
  102ada:	8b 45 cc             	mov    -0x34(%ebp),%eax
  102add:	8b 55 d4             	mov    -0x2c(%ebp),%edx
  102ae0:	89 10                	mov    %edx,(%eax)
  102ae2:	8b 45 cc             	mov    -0x34(%ebp),%eax
  102ae5:	8b 10                	mov    (%eax),%edx
  102ae7:	8b 45 d0             	mov    -0x30(%ebp),%eax
  102aea:	89 50 04             	mov    %edx,0x4(%eax)
    elm->next = next;
  102aed:	8b 45 d4             	mov    -0x2c(%ebp),%eax
  102af0:	8b 55 cc             	mov    -0x34(%ebp),%edx
  102af3:	89 50 04             	mov    %edx,0x4(%eax)
    elm->prev = prev;
  102af6:	8b 45 d4             	mov    -0x2c(%ebp),%eax
  102af9:	8b 55 d0             	mov    -0x30(%ebp),%edx
  102afc:	89 10                	mov    %edx,(%eax)

static void
default_init_memmap(struct Page *base, size_t n) {
    assert(n > 0);
    struct Page *p = base;
    for (; p != base + n; p ++) {
  102afe:	83 45 f4 14          	addl   $0x14,-0xc(%ebp)
  102b02:	8b 55 0c             	mov    0xc(%ebp),%edx
  102b05:	89 d0                	mov    %edx,%eax
  102b07:	c1 e0 02             	shl    $0x2,%eax
  102b0a:	01 d0                	add    %edx,%eax
  102b0c:	c1 e0 02             	shl    $0x2,%eax
  102b0f:	89 c2                	mov    %eax,%edx
  102b11:	8b 45 08             	mov    0x8(%ebp),%eax
  102b14:	01 d0                	add    %edx,%eax
  102b16:	3b 45 f4             	cmp    -0xc(%ebp),%eax
  102b19:	0f 85 07 ff ff ff    	jne    102a26 <default_init_memmap+0x3b>
        SetPageProperty(p);
        p->property = 0;
        set_page_ref(p, 0);
        list_add_before(&free_list, &(p->page_link));
    }
    nr_free += n;
  102b1f:	8b 15 b8 89 11 00    	mov    0x1189b8,%edx
  102b25:	8b 45 0c             	mov    0xc(%ebp),%eax
  102b28:	01 d0                	add    %edx,%eax
  102b2a:	a3 b8 89 11 00       	mov    %eax,0x1189b8
    //first block
    base->property = n;
  102b2f:	8b 45 08             	mov    0x8(%ebp),%eax
  102b32:	8b 55 0c             	mov    0xc(%ebp),%edx
  102b35:	89 50 08             	mov    %edx,0x8(%eax)
}
  102b38:	c9                   	leave  
  102b39:	c3                   	ret    

00102b3a <default_alloc_pages>:

static struct Page *
default_alloc_pages(size_t n) {
  102b3a:	55                   	push   %ebp
  102b3b:	89 e5                	mov    %esp,%ebp
  102b3d:	83 ec 68             	sub    $0x68,%esp
    assert(n > 0);
  102b40:	83 7d 08 00          	cmpl   $0x0,0x8(%ebp)
  102b44:	75 24                	jne    102b6a <default_alloc_pages+0x30>
  102b46:	c7 44 24 0c 50 67 10 	movl   $0x106750,0xc(%esp)
  102b4d:	00 
  102b4e:	c7 44 24 08 56 67 10 	movl   $0x106756,0x8(%esp)
  102b55:	00 
  102b56:	c7 44 24 04 57 00 00 	movl   $0x57,0x4(%esp)
  102b5d:	00 
  102b5e:	c7 04 24 6b 67 10 00 	movl   $0x10676b,(%esp)
  102b65:	e8 5c e1 ff ff       	call   100cc6 <__panic>
    if (n > nr_free) {
  102b6a:	a1 b8 89 11 00       	mov    0x1189b8,%eax
  102b6f:	3b 45 08             	cmp    0x8(%ebp),%eax
  102b72:	73 0a                	jae    102b7e <default_alloc_pages+0x44>
        return NULL;
  102b74:	b8 00 00 00 00       	mov    $0x0,%eax
  102b79:	e9 37 01 00 00       	jmp    102cb5 <default_alloc_pages+0x17b>
    }
    list_entry_t *le, *len;
    le = &free_list;
  102b7e:	c7 45 f4 b0 89 11 00 	movl   $0x1189b0,-0xc(%ebp)

    while((le=list_next(le)) != &free_list) {
  102b85:	e9 0a 01 00 00       	jmp    102c94 <default_alloc_pages+0x15a>
      struct Page *p = le2page(le, page_link);
  102b8a:	8b 45 f4             	mov    -0xc(%ebp),%eax
  102b8d:	83 e8 0c             	sub    $0xc,%eax
  102b90:	89 45 ec             	mov    %eax,-0x14(%ebp)
      if(p->property >= n){
  102b93:	8b 45 ec             	mov    -0x14(%ebp),%eax
  102b96:	8b 40 08             	mov    0x8(%eax),%eax
  102b99:	3b 45 08             	cmp    0x8(%ebp),%eax
  102b9c:	0f 82 f2 00 00 00    	jb     102c94 <default_alloc_pages+0x15a>
        int i;
        for(i=0;i<n;i++){
  102ba2:	c7 45 f0 00 00 00 00 	movl   $0x0,-0x10(%ebp)
  102ba9:	eb 7c                	jmp    102c27 <default_alloc_pages+0xed>
  102bab:	8b 45 f4             	mov    -0xc(%ebp),%eax
  102bae:	89 45 e0             	mov    %eax,-0x20(%ebp)
 * list_next - get the next entry
 * @listelm:    the list head
 **/
static inline list_entry_t *
list_next(list_entry_t *listelm) {
    return listelm->next;
  102bb1:	8b 45 e0             	mov    -0x20(%ebp),%eax
  102bb4:	8b 40 04             	mov    0x4(%eax),%eax
          len = list_next(le);
  102bb7:	89 45 e8             	mov    %eax,-0x18(%ebp)
          struct Page *pp = le2page(le, page_link);
  102bba:	8b 45 f4             	mov    -0xc(%ebp),%eax
  102bbd:	83 e8 0c             	sub    $0xc,%eax
  102bc0:	89 45 e4             	mov    %eax,-0x1c(%ebp)
          SetPageReserved(pp);
  102bc3:	8b 45 e4             	mov    -0x1c(%ebp),%eax
  102bc6:	83 c0 04             	add    $0x4,%eax
  102bc9:	c7 45 dc 00 00 00 00 	movl   $0x0,-0x24(%ebp)
  102bd0:	89 45 d8             	mov    %eax,-0x28(%ebp)
  102bd3:	8b 45 d8             	mov    -0x28(%ebp),%eax
  102bd6:	8b 55 dc             	mov    -0x24(%ebp),%edx
  102bd9:	0f ab 10             	bts    %edx,(%eax)
          ClearPageProperty(pp);
  102bdc:	8b 45 e4             	mov    -0x1c(%ebp),%eax
  102bdf:	83 c0 04             	add    $0x4,%eax
  102be2:	c7 45 d4 01 00 00 00 	movl   $0x1,-0x2c(%ebp)
  102be9:	89 45 d0             	mov    %eax,-0x30(%ebp)
 * @nr:     the bit to clear
 * @addr:   the address to start counting from
 * */
static inline void
clear_bit(int nr, volatile void *addr) {
    asm volatile ("btrl %1, %0" :"=m" (*(volatile long *)addr) : "Ir" (nr));
  102bec:	8b 45 d0             	mov    -0x30(%ebp),%eax
  102bef:	8b 55 d4             	mov    -0x2c(%ebp),%edx
  102bf2:	0f b3 10             	btr    %edx,(%eax)
  102bf5:	8b 45 f4             	mov    -0xc(%ebp),%eax
  102bf8:	89 45 cc             	mov    %eax,-0x34(%ebp)
 * Note: list_empty() on @listelm does not return true after this, the entry is
 * in an undefined state.
 * */
static inline void
list_del(list_entry_t *listelm) {
    __list_del(listelm->prev, listelm->next);
  102bfb:	8b 45 cc             	mov    -0x34(%ebp),%eax
  102bfe:	8b 40 04             	mov    0x4(%eax),%eax
  102c01:	8b 55 cc             	mov    -0x34(%ebp),%edx
  102c04:	8b 12                	mov    (%edx),%edx
  102c06:	89 55 c8             	mov    %edx,-0x38(%ebp)
  102c09:	89 45 c4             	mov    %eax,-0x3c(%ebp)
 * This is only for internal list manipulation where we know
 * the prev/next entries already!
 * */
static inline void
__list_del(list_entry_t *prev, list_entry_t *next) {
    prev->next = next;
  102c0c:	8b 45 c8             	mov    -0x38(%ebp),%eax
  102c0f:	8b 55 c4             	mov    -0x3c(%ebp),%edx
  102c12:	89 50 04             	mov    %edx,0x4(%eax)
    next->prev = prev;
  102c15:	8b 45 c4             	mov    -0x3c(%ebp),%eax
  102c18:	8b 55 c8             	mov    -0x38(%ebp),%edx
  102c1b:	89 10                	mov    %edx,(%eax)
          list_del(le);
          le = len;
  102c1d:	8b 45 e8             	mov    -0x18(%ebp),%eax
  102c20:	89 45 f4             	mov    %eax,-0xc(%ebp)

    while((le=list_next(le)) != &free_list) {
      struct Page *p = le2page(le, page_link);
      if(p->property >= n){
        int i;
        for(i=0;i<n;i++){
  102c23:	83 45 f0 01          	addl   $0x1,-0x10(%ebp)
  102c27:	8b 45 f0             	mov    -0x10(%ebp),%eax
  102c2a:	3b 45 08             	cmp    0x8(%ebp),%eax
  102c2d:	0f 82 78 ff ff ff    	jb     102bab <default_alloc_pages+0x71>
          SetPageReserved(pp);
          ClearPageProperty(pp);
          list_del(le);
          le = len;
        }
        if(p->property>n){
  102c33:	8b 45 ec             	mov    -0x14(%ebp),%eax
  102c36:	8b 40 08             	mov    0x8(%eax),%eax
  102c39:	3b 45 08             	cmp    0x8(%ebp),%eax
  102c3c:	76 12                	jbe    102c50 <default_alloc_pages+0x116>
          (le2page(le,page_link))->property = p->property - n;
  102c3e:	8b 45 f4             	mov    -0xc(%ebp),%eax
  102c41:	8d 50 f4             	lea    -0xc(%eax),%edx
  102c44:	8b 45 ec             	mov    -0x14(%ebp),%eax
  102c47:	8b 40 08             	mov    0x8(%eax),%eax
  102c4a:	2b 45 08             	sub    0x8(%ebp),%eax
  102c4d:	89 42 08             	mov    %eax,0x8(%edx)
        }
        ClearPageProperty(p);
  102c50:	8b 45 ec             	mov    -0x14(%ebp),%eax
  102c53:	83 c0 04             	add    $0x4,%eax
  102c56:	c7 45 c0 01 00 00 00 	movl   $0x1,-0x40(%ebp)
  102c5d:	89 45 bc             	mov    %eax,-0x44(%ebp)
  102c60:	8b 45 bc             	mov    -0x44(%ebp),%eax
  102c63:	8b 55 c0             	mov    -0x40(%ebp),%edx
  102c66:	0f b3 10             	btr    %edx,(%eax)
        SetPageReserved(p);
  102c69:	8b 45 ec             	mov    -0x14(%ebp),%eax
  102c6c:	83 c0 04             	add    $0x4,%eax
  102c6f:	c7 45 b8 00 00 00 00 	movl   $0x0,-0x48(%ebp)
  102c76:	89 45 b4             	mov    %eax,-0x4c(%ebp)
 * Note that @nr may be almost arbitrarily large; this function is not
 * restricted to acting on a single-word quantity.
 * */
static inline void
set_bit(int nr, volatile void *addr) {
    asm volatile ("btsl %1, %0" :"=m" (*(volatile long *)addr) : "Ir" (nr));
  102c79:	8b 45 b4             	mov    -0x4c(%ebp),%eax
  102c7c:	8b 55 b8             	mov    -0x48(%ebp),%edx
  102c7f:	0f ab 10             	bts    %edx,(%eax)
        nr_free -= n;
  102c82:	a1 b8 89 11 00       	mov    0x1189b8,%eax
  102c87:	2b 45 08             	sub    0x8(%ebp),%eax
  102c8a:	a3 b8 89 11 00       	mov    %eax,0x1189b8
        return p;
  102c8f:	8b 45 ec             	mov    -0x14(%ebp),%eax
  102c92:	eb 21                	jmp    102cb5 <default_alloc_pages+0x17b>
  102c94:	8b 45 f4             	mov    -0xc(%ebp),%eax
  102c97:	89 45 b0             	mov    %eax,-0x50(%ebp)
 * list_next - get the next entry
 * @listelm:    the list head
 **/
static inline list_entry_t *
list_next(list_entry_t *listelm) {
    return listelm->next;
  102c9a:	8b 45 b0             	mov    -0x50(%ebp),%eax
  102c9d:	8b 40 04             	mov    0x4(%eax),%eax
        return NULL;
    }
    list_entry_t *le, *len;
    le = &free_list;

    while((le=list_next(le)) != &free_list) {
  102ca0:	89 45 f4             	mov    %eax,-0xc(%ebp)
  102ca3:	81 7d f4 b0 89 11 00 	cmpl   $0x1189b0,-0xc(%ebp)
  102caa:	0f 85 da fe ff ff    	jne    102b8a <default_alloc_pages+0x50>
        SetPageReserved(p);
        nr_free -= n;
        return p;
      }
    }
    return NULL;
  102cb0:	b8 00 00 00 00       	mov    $0x0,%eax
}
  102cb5:	c9                   	leave  
  102cb6:	c3                   	ret    

00102cb7 <default_free_pages>:

static void
default_free_pages(struct Page *base, size_t n) {
  102cb7:	55                   	push   %ebp
  102cb8:	89 e5                	mov    %esp,%ebp
  102cba:	83 ec 68             	sub    $0x68,%esp
    assert(n > 0);
  102cbd:	83 7d 0c 00          	cmpl   $0x0,0xc(%ebp)
  102cc1:	75 24                	jne    102ce7 <default_free_pages+0x30>
  102cc3:	c7 44 24 0c 50 67 10 	movl   $0x106750,0xc(%esp)
  102cca:	00 
  102ccb:	c7 44 24 08 56 67 10 	movl   $0x106756,0x8(%esp)
  102cd2:	00 
  102cd3:	c7 44 24 04 78 00 00 	movl   $0x78,0x4(%esp)
  102cda:	00 
  102cdb:	c7 04 24 6b 67 10 00 	movl   $0x10676b,(%esp)
  102ce2:	e8 df df ff ff       	call   100cc6 <__panic>
    assert(PageReserved(base));
  102ce7:	8b 45 08             	mov    0x8(%ebp),%eax
  102cea:	83 c0 04             	add    $0x4,%eax
  102ced:	c7 45 ec 00 00 00 00 	movl   $0x0,-0x14(%ebp)
  102cf4:	89 45 e8             	mov    %eax,-0x18(%ebp)
 * @addr:   the address to count from
 * */
static inline bool
test_bit(int nr, volatile void *addr) {
    int oldbit;
    asm volatile ("btl %2, %1; sbbl %0,%0" : "=r" (oldbit) : "m" (*(volatile long *)addr), "Ir" (nr));
  102cf7:	8b 45 e8             	mov    -0x18(%ebp),%eax
  102cfa:	8b 55 ec             	mov    -0x14(%ebp),%edx
  102cfd:	0f a3 10             	bt     %edx,(%eax)
  102d00:	19 c0                	sbb    %eax,%eax
  102d02:	89 45 e4             	mov    %eax,-0x1c(%ebp)
    return oldbit != 0;
  102d05:	83 7d e4 00          	cmpl   $0x0,-0x1c(%ebp)
  102d09:	0f 95 c0             	setne  %al
  102d0c:	0f b6 c0             	movzbl %al,%eax
  102d0f:	85 c0                	test   %eax,%eax
  102d11:	75 24                	jne    102d37 <default_free_pages+0x80>
  102d13:	c7 44 24 0c 91 67 10 	movl   $0x106791,0xc(%esp)
  102d1a:	00 
  102d1b:	c7 44 24 08 56 67 10 	movl   $0x106756,0x8(%esp)
  102d22:	00 
  102d23:	c7 44 24 04 79 00 00 	movl   $0x79,0x4(%esp)
  102d2a:	00 
  102d2b:	c7 04 24 6b 67 10 00 	movl   $0x10676b,(%esp)
  102d32:	e8 8f df ff ff       	call   100cc6 <__panic>

    list_entry_t *le = &free_list;
  102d37:	c7 45 f4 b0 89 11 00 	movl   $0x1189b0,-0xc(%ebp)
    struct Page * p;
    while((le=list_next(le)) != &free_list) {
  102d3e:	eb 13                	jmp    102d53 <default_free_pages+0x9c>
      p = le2page(le, page_link);
  102d40:	8b 45 f4             	mov    -0xc(%ebp),%eax
  102d43:	83 e8 0c             	sub    $0xc,%eax
  102d46:	89 45 f0             	mov    %eax,-0x10(%ebp)
      if(p>base){
  102d49:	8b 45 f0             	mov    -0x10(%ebp),%eax
  102d4c:	3b 45 08             	cmp    0x8(%ebp),%eax
  102d4f:	76 02                	jbe    102d53 <default_free_pages+0x9c>
        break;
  102d51:	eb 18                	jmp    102d6b <default_free_pages+0xb4>
  102d53:	8b 45 f4             	mov    -0xc(%ebp),%eax
  102d56:	89 45 e0             	mov    %eax,-0x20(%ebp)
  102d59:	8b 45 e0             	mov    -0x20(%ebp),%eax
  102d5c:	8b 40 04             	mov    0x4(%eax),%eax
    assert(n > 0);
    assert(PageReserved(base));

    list_entry_t *le = &free_list;
    struct Page * p;
    while((le=list_next(le)) != &free_list) {
  102d5f:	89 45 f4             	mov    %eax,-0xc(%ebp)
  102d62:	81 7d f4 b0 89 11 00 	cmpl   $0x1189b0,-0xc(%ebp)
  102d69:	75 d5                	jne    102d40 <default_free_pages+0x89>
      if(p>base){
        break;
      }
    }
    //list_add_before(le, base->page_link);
    for(p=base;p<base+n;p++){
  102d6b:	8b 45 08             	mov    0x8(%ebp),%eax
  102d6e:	89 45 f0             	mov    %eax,-0x10(%ebp)
  102d71:	eb 4b                	jmp    102dbe <default_free_pages+0x107>
      list_add_before(le, &(p->page_link));
  102d73:	8b 45 f0             	mov    -0x10(%ebp),%eax
  102d76:	8d 50 0c             	lea    0xc(%eax),%edx
  102d79:	8b 45 f4             	mov    -0xc(%ebp),%eax
  102d7c:	89 45 dc             	mov    %eax,-0x24(%ebp)
  102d7f:	89 55 d8             	mov    %edx,-0x28(%ebp)
 * Insert the new element @elm *before* the element @listelm which
 * is already in the list.
 * */
static inline void
list_add_before(list_entry_t *listelm, list_entry_t *elm) {
    __list_add(elm, listelm->prev, listelm);
  102d82:	8b 45 dc             	mov    -0x24(%ebp),%eax
  102d85:	8b 00                	mov    (%eax),%eax
  102d87:	8b 55 d8             	mov    -0x28(%ebp),%edx
  102d8a:	89 55 d4             	mov    %edx,-0x2c(%ebp)
  102d8d:	89 45 d0             	mov    %eax,-0x30(%ebp)
  102d90:	8b 45 dc             	mov    -0x24(%ebp),%eax
  102d93:	89 45 cc             	mov    %eax,-0x34(%ebp)
 * This is only for internal list manipulation where we know
 * the prev/next entries already!
 * */
static inline void
__list_add(list_entry_t *elm, list_entry_t *prev, list_entry_t *next) {
    prev->next = next->prev = elm;
  102d96:	8b 45 cc             	mov    -0x34(%ebp),%eax
  102d99:	8b 55 d4             	mov    -0x2c(%ebp),%edx
  102d9c:	89 10                	mov    %edx,(%eax)
  102d9e:	8b 45 cc             	mov    -0x34(%ebp),%eax
  102da1:	8b 10                	mov    (%eax),%edx
  102da3:	8b 45 d0             	mov    -0x30(%ebp),%eax
  102da6:	89 50 04             	mov    %edx,0x4(%eax)
    elm->next = next;
  102da9:	8b 45 d4             	mov    -0x2c(%ebp),%eax
  102dac:	8b 55 cc             	mov    -0x34(%ebp),%edx
  102daf:	89 50 04             	mov    %edx,0x4(%eax)
    elm->prev = prev;
  102db2:	8b 45 d4             	mov    -0x2c(%ebp),%eax
  102db5:	8b 55 d0             	mov    -0x30(%ebp),%edx
  102db8:	89 10                	mov    %edx,(%eax)
      if(p>base){
        break;
      }
    }
    //list_add_before(le, base->page_link);
    for(p=base;p<base+n;p++){
  102dba:	83 45 f0 14          	addl   $0x14,-0x10(%ebp)
  102dbe:	8b 55 0c             	mov    0xc(%ebp),%edx
  102dc1:	89 d0                	mov    %edx,%eax
  102dc3:	c1 e0 02             	shl    $0x2,%eax
  102dc6:	01 d0                	add    %edx,%eax
  102dc8:	c1 e0 02             	shl    $0x2,%eax
  102dcb:	89 c2                	mov    %eax,%edx
  102dcd:	8b 45 08             	mov    0x8(%ebp),%eax
  102dd0:	01 d0                	add    %edx,%eax
  102dd2:	3b 45 f0             	cmp    -0x10(%ebp),%eax
  102dd5:	77 9c                	ja     102d73 <default_free_pages+0xbc>
      list_add_before(le, &(p->page_link));
    }
    base->flags = 0;
  102dd7:	8b 45 08             	mov    0x8(%ebp),%eax
  102dda:	c7 40 04 00 00 00 00 	movl   $0x0,0x4(%eax)
    set_page_ref(base, 0);
  102de1:	c7 44 24 04 00 00 00 	movl   $0x0,0x4(%esp)
  102de8:	00 
  102de9:	8b 45 08             	mov    0x8(%ebp),%eax
  102dec:	89 04 24             	mov    %eax,(%esp)
  102def:	e8 bd fb ff ff       	call   1029b1 <set_page_ref>
    ClearPageProperty(base);
  102df4:	8b 45 08             	mov    0x8(%ebp),%eax
  102df7:	83 c0 04             	add    $0x4,%eax
  102dfa:	c7 45 c8 01 00 00 00 	movl   $0x1,-0x38(%ebp)
  102e01:	89 45 c4             	mov    %eax,-0x3c(%ebp)
 * @nr:     the bit to clear
 * @addr:   the address to start counting from
 * */
static inline void
clear_bit(int nr, volatile void *addr) {
    asm volatile ("btrl %1, %0" :"=m" (*(volatile long *)addr) : "Ir" (nr));
  102e04:	8b 45 c4             	mov    -0x3c(%ebp),%eax
  102e07:	8b 55 c8             	mov    -0x38(%ebp),%edx
  102e0a:	0f b3 10             	btr    %edx,(%eax)
    SetPageProperty(base);
  102e0d:	8b 45 08             	mov    0x8(%ebp),%eax
  102e10:	83 c0 04             	add    $0x4,%eax
  102e13:	c7 45 c0 01 00 00 00 	movl   $0x1,-0x40(%ebp)
  102e1a:	89 45 bc             	mov    %eax,-0x44(%ebp)
 * Note that @nr may be almost arbitrarily large; this function is not
 * restricted to acting on a single-word quantity.
 * */
static inline void
set_bit(int nr, volatile void *addr) {
    asm volatile ("btsl %1, %0" :"=m" (*(volatile long *)addr) : "Ir" (nr));
  102e1d:	8b 45 bc             	mov    -0x44(%ebp),%eax
  102e20:	8b 55 c0             	mov    -0x40(%ebp),%edx
  102e23:	0f ab 10             	bts    %edx,(%eax)
    base->property = n;
  102e26:	8b 45 08             	mov    0x8(%ebp),%eax
  102e29:	8b 55 0c             	mov    0xc(%ebp),%edx
  102e2c:	89 50 08             	mov    %edx,0x8(%eax)
    
    p = le2page(le,page_link) ;
  102e2f:	8b 45 f4             	mov    -0xc(%ebp),%eax
  102e32:	83 e8 0c             	sub    $0xc,%eax
  102e35:	89 45 f0             	mov    %eax,-0x10(%ebp)
    if( base+n == p ){
  102e38:	8b 55 0c             	mov    0xc(%ebp),%edx
  102e3b:	89 d0                	mov    %edx,%eax
  102e3d:	c1 e0 02             	shl    $0x2,%eax
  102e40:	01 d0                	add    %edx,%eax
  102e42:	c1 e0 02             	shl    $0x2,%eax
  102e45:	89 c2                	mov    %eax,%edx
  102e47:	8b 45 08             	mov    0x8(%ebp),%eax
  102e4a:	01 d0                	add    %edx,%eax
  102e4c:	3b 45 f0             	cmp    -0x10(%ebp),%eax
  102e4f:	75 1e                	jne    102e6f <default_free_pages+0x1b8>
      base->property += p->property;
  102e51:	8b 45 08             	mov    0x8(%ebp),%eax
  102e54:	8b 50 08             	mov    0x8(%eax),%edx
  102e57:	8b 45 f0             	mov    -0x10(%ebp),%eax
  102e5a:	8b 40 08             	mov    0x8(%eax),%eax
  102e5d:	01 c2                	add    %eax,%edx
  102e5f:	8b 45 08             	mov    0x8(%ebp),%eax
  102e62:	89 50 08             	mov    %edx,0x8(%eax)
      p->property = 0;
  102e65:	8b 45 f0             	mov    -0x10(%ebp),%eax
  102e68:	c7 40 08 00 00 00 00 	movl   $0x0,0x8(%eax)
    }
    le = list_prev(&(base->page_link));
  102e6f:	8b 45 08             	mov    0x8(%ebp),%eax
  102e72:	83 c0 0c             	add    $0xc,%eax
  102e75:	89 45 b8             	mov    %eax,-0x48(%ebp)
 * list_prev - get the previous entry
 * @listelm:    the list head
 **/
static inline list_entry_t *
list_prev(list_entry_t *listelm) {
    return listelm->prev;
  102e78:	8b 45 b8             	mov    -0x48(%ebp),%eax
  102e7b:	8b 00                	mov    (%eax),%eax
  102e7d:	89 45 f4             	mov    %eax,-0xc(%ebp)
    p = le2page(le, page_link);
  102e80:	8b 45 f4             	mov    -0xc(%ebp),%eax
  102e83:	83 e8 0c             	sub    $0xc,%eax
  102e86:	89 45 f0             	mov    %eax,-0x10(%ebp)
    if(le!=&free_list && p==base-1){
  102e89:	81 7d f4 b0 89 11 00 	cmpl   $0x1189b0,-0xc(%ebp)
  102e90:	74 57                	je     102ee9 <default_free_pages+0x232>
  102e92:	8b 45 08             	mov    0x8(%ebp),%eax
  102e95:	83 e8 14             	sub    $0x14,%eax
  102e98:	3b 45 f0             	cmp    -0x10(%ebp),%eax
  102e9b:	75 4c                	jne    102ee9 <default_free_pages+0x232>
      while(le!=&free_list){
  102e9d:	eb 41                	jmp    102ee0 <default_free_pages+0x229>
        if(p->property){
  102e9f:	8b 45 f0             	mov    -0x10(%ebp),%eax
  102ea2:	8b 40 08             	mov    0x8(%eax),%eax
  102ea5:	85 c0                	test   %eax,%eax
  102ea7:	74 20                	je     102ec9 <default_free_pages+0x212>
          p->property += base->property;
  102ea9:	8b 45 f0             	mov    -0x10(%ebp),%eax
  102eac:	8b 50 08             	mov    0x8(%eax),%edx
  102eaf:	8b 45 08             	mov    0x8(%ebp),%eax
  102eb2:	8b 40 08             	mov    0x8(%eax),%eax
  102eb5:	01 c2                	add    %eax,%edx
  102eb7:	8b 45 f0             	mov    -0x10(%ebp),%eax
  102eba:	89 50 08             	mov    %edx,0x8(%eax)
          base->property = 0;
  102ebd:	8b 45 08             	mov    0x8(%ebp),%eax
  102ec0:	c7 40 08 00 00 00 00 	movl   $0x0,0x8(%eax)
          break;
  102ec7:	eb 20                	jmp    102ee9 <default_free_pages+0x232>
  102ec9:	8b 45 f4             	mov    -0xc(%ebp),%eax
  102ecc:	89 45 b4             	mov    %eax,-0x4c(%ebp)
  102ecf:	8b 45 b4             	mov    -0x4c(%ebp),%eax
  102ed2:	8b 00                	mov    (%eax),%eax
        }
        le = list_prev(le);
  102ed4:	89 45 f4             	mov    %eax,-0xc(%ebp)
        p = le2page(le,page_link);
  102ed7:	8b 45 f4             	mov    -0xc(%ebp),%eax
  102eda:	83 e8 0c             	sub    $0xc,%eax
  102edd:	89 45 f0             	mov    %eax,-0x10(%ebp)
      p->property = 0;
    }
    le = list_prev(&(base->page_link));
    p = le2page(le, page_link);
    if(le!=&free_list && p==base-1){
      while(le!=&free_list){
  102ee0:	81 7d f4 b0 89 11 00 	cmpl   $0x1189b0,-0xc(%ebp)
  102ee7:	75 b6                	jne    102e9f <default_free_pages+0x1e8>
        le = list_prev(le);
        p = le2page(le,page_link);
      }
    }

    nr_free += n;
  102ee9:	8b 15 b8 89 11 00    	mov    0x1189b8,%edx
  102eef:	8b 45 0c             	mov    0xc(%ebp),%eax
  102ef2:	01 d0                	add    %edx,%eax
  102ef4:	a3 b8 89 11 00       	mov    %eax,0x1189b8
    return ;
  102ef9:	90                   	nop
}
  102efa:	c9                   	leave  
  102efb:	c3                   	ret    

00102efc <default_nr_free_pages>:

static size_t
default_nr_free_pages(void) {
  102efc:	55                   	push   %ebp
  102efd:	89 e5                	mov    %esp,%ebp
    return nr_free;
  102eff:	a1 b8 89 11 00       	mov    0x1189b8,%eax
}
  102f04:	5d                   	pop    %ebp
  102f05:	c3                   	ret    

00102f06 <basic_check>:

static void
basic_check(void) {
  102f06:	55                   	push   %ebp
  102f07:	89 e5                	mov    %esp,%ebp
  102f09:	83 ec 48             	sub    $0x48,%esp
    struct Page *p0, *p1, *p2;
    p0 = p1 = p2 = NULL;
  102f0c:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)
  102f13:	8b 45 f4             	mov    -0xc(%ebp),%eax
  102f16:	89 45 f0             	mov    %eax,-0x10(%ebp)
  102f19:	8b 45 f0             	mov    -0x10(%ebp),%eax
  102f1c:	89 45 ec             	mov    %eax,-0x14(%ebp)
    assert((p0 = alloc_page()) != NULL);
  102f1f:	c7 04 24 01 00 00 00 	movl   $0x1,(%esp)
  102f26:	e8 85 0e 00 00       	call   103db0 <alloc_pages>
  102f2b:	89 45 ec             	mov    %eax,-0x14(%ebp)
  102f2e:	83 7d ec 00          	cmpl   $0x0,-0x14(%ebp)
  102f32:	75 24                	jne    102f58 <basic_check+0x52>
  102f34:	c7 44 24 0c a4 67 10 	movl   $0x1067a4,0xc(%esp)
  102f3b:	00 
  102f3c:	c7 44 24 08 56 67 10 	movl   $0x106756,0x8(%esp)
  102f43:	00 
  102f44:	c7 44 24 04 ad 00 00 	movl   $0xad,0x4(%esp)
  102f4b:	00 
  102f4c:	c7 04 24 6b 67 10 00 	movl   $0x10676b,(%esp)
  102f53:	e8 6e dd ff ff       	call   100cc6 <__panic>
    assert((p1 = alloc_page()) != NULL);
  102f58:	c7 04 24 01 00 00 00 	movl   $0x1,(%esp)
  102f5f:	e8 4c 0e 00 00       	call   103db0 <alloc_pages>
  102f64:	89 45 f0             	mov    %eax,-0x10(%ebp)
  102f67:	83 7d f0 00          	cmpl   $0x0,-0x10(%ebp)
  102f6b:	75 24                	jne    102f91 <basic_check+0x8b>
  102f6d:	c7 44 24 0c c0 67 10 	movl   $0x1067c0,0xc(%esp)
  102f74:	00 
  102f75:	c7 44 24 08 56 67 10 	movl   $0x106756,0x8(%esp)
  102f7c:	00 
  102f7d:	c7 44 24 04 ae 00 00 	movl   $0xae,0x4(%esp)
  102f84:	00 
  102f85:	c7 04 24 6b 67 10 00 	movl   $0x10676b,(%esp)
  102f8c:	e8 35 dd ff ff       	call   100cc6 <__panic>
    assert((p2 = alloc_page()) != NULL);
  102f91:	c7 04 24 01 00 00 00 	movl   $0x1,(%esp)
  102f98:	e8 13 0e 00 00       	call   103db0 <alloc_pages>
  102f9d:	89 45 f4             	mov    %eax,-0xc(%ebp)
  102fa0:	83 7d f4 00          	cmpl   $0x0,-0xc(%ebp)
  102fa4:	75 24                	jne    102fca <basic_check+0xc4>
  102fa6:	c7 44 24 0c dc 67 10 	movl   $0x1067dc,0xc(%esp)
  102fad:	00 
  102fae:	c7 44 24 08 56 67 10 	movl   $0x106756,0x8(%esp)
  102fb5:	00 
  102fb6:	c7 44 24 04 af 00 00 	movl   $0xaf,0x4(%esp)
  102fbd:	00 
  102fbe:	c7 04 24 6b 67 10 00 	movl   $0x10676b,(%esp)
  102fc5:	e8 fc dc ff ff       	call   100cc6 <__panic>

    assert(p0 != p1 && p0 != p2 && p1 != p2);
  102fca:	8b 45 ec             	mov    -0x14(%ebp),%eax
  102fcd:	3b 45 f0             	cmp    -0x10(%ebp),%eax
  102fd0:	74 10                	je     102fe2 <basic_check+0xdc>
  102fd2:	8b 45 ec             	mov    -0x14(%ebp),%eax
  102fd5:	3b 45 f4             	cmp    -0xc(%ebp),%eax
  102fd8:	74 08                	je     102fe2 <basic_check+0xdc>
  102fda:	8b 45 f0             	mov    -0x10(%ebp),%eax
  102fdd:	3b 45 f4             	cmp    -0xc(%ebp),%eax
  102fe0:	75 24                	jne    103006 <basic_check+0x100>
  102fe2:	c7 44 24 0c f8 67 10 	movl   $0x1067f8,0xc(%esp)
  102fe9:	00 
  102fea:	c7 44 24 08 56 67 10 	movl   $0x106756,0x8(%esp)
  102ff1:	00 
  102ff2:	c7 44 24 04 b1 00 00 	movl   $0xb1,0x4(%esp)
  102ff9:	00 
  102ffa:	c7 04 24 6b 67 10 00 	movl   $0x10676b,(%esp)
  103001:	e8 c0 dc ff ff       	call   100cc6 <__panic>
    assert(page_ref(p0) == 0 && page_ref(p1) == 0 && page_ref(p2) == 0);
  103006:	8b 45 ec             	mov    -0x14(%ebp),%eax
  103009:	89 04 24             	mov    %eax,(%esp)
  10300c:	e8 96 f9 ff ff       	call   1029a7 <page_ref>
  103011:	85 c0                	test   %eax,%eax
  103013:	75 1e                	jne    103033 <basic_check+0x12d>
  103015:	8b 45 f0             	mov    -0x10(%ebp),%eax
  103018:	89 04 24             	mov    %eax,(%esp)
  10301b:	e8 87 f9 ff ff       	call   1029a7 <page_ref>
  103020:	85 c0                	test   %eax,%eax
  103022:	75 0f                	jne    103033 <basic_check+0x12d>
  103024:	8b 45 f4             	mov    -0xc(%ebp),%eax
  103027:	89 04 24             	mov    %eax,(%esp)
  10302a:	e8 78 f9 ff ff       	call   1029a7 <page_ref>
  10302f:	85 c0                	test   %eax,%eax
  103031:	74 24                	je     103057 <basic_check+0x151>
  103033:	c7 44 24 0c 1c 68 10 	movl   $0x10681c,0xc(%esp)
  10303a:	00 
  10303b:	c7 44 24 08 56 67 10 	movl   $0x106756,0x8(%esp)
  103042:	00 
  103043:	c7 44 24 04 b2 00 00 	movl   $0xb2,0x4(%esp)
  10304a:	00 
  10304b:	c7 04 24 6b 67 10 00 	movl   $0x10676b,(%esp)
  103052:	e8 6f dc ff ff       	call   100cc6 <__panic>

    assert(page2pa(p0) < npage * PGSIZE);
  103057:	8b 45 ec             	mov    -0x14(%ebp),%eax
  10305a:	89 04 24             	mov    %eax,(%esp)
  10305d:	e8 2f f9 ff ff       	call   102991 <page2pa>
  103062:	8b 15 c0 88 11 00    	mov    0x1188c0,%edx
  103068:	c1 e2 0c             	shl    $0xc,%edx
  10306b:	39 d0                	cmp    %edx,%eax
  10306d:	72 24                	jb     103093 <basic_check+0x18d>
  10306f:	c7 44 24 0c 58 68 10 	movl   $0x106858,0xc(%esp)
  103076:	00 
  103077:	c7 44 24 08 56 67 10 	movl   $0x106756,0x8(%esp)
  10307e:	00 
  10307f:	c7 44 24 04 b4 00 00 	movl   $0xb4,0x4(%esp)
  103086:	00 
  103087:	c7 04 24 6b 67 10 00 	movl   $0x10676b,(%esp)
  10308e:	e8 33 dc ff ff       	call   100cc6 <__panic>
    assert(page2pa(p1) < npage * PGSIZE);
  103093:	8b 45 f0             	mov    -0x10(%ebp),%eax
  103096:	89 04 24             	mov    %eax,(%esp)
  103099:	e8 f3 f8 ff ff       	call   102991 <page2pa>
  10309e:	8b 15 c0 88 11 00    	mov    0x1188c0,%edx
  1030a4:	c1 e2 0c             	shl    $0xc,%edx
  1030a7:	39 d0                	cmp    %edx,%eax
  1030a9:	72 24                	jb     1030cf <basic_check+0x1c9>
  1030ab:	c7 44 24 0c 75 68 10 	movl   $0x106875,0xc(%esp)
  1030b2:	00 
  1030b3:	c7 44 24 08 56 67 10 	movl   $0x106756,0x8(%esp)
  1030ba:	00 
  1030bb:	c7 44 24 04 b5 00 00 	movl   $0xb5,0x4(%esp)
  1030c2:	00 
  1030c3:	c7 04 24 6b 67 10 00 	movl   $0x10676b,(%esp)
  1030ca:	e8 f7 db ff ff       	call   100cc6 <__panic>
    assert(page2pa(p2) < npage * PGSIZE);
  1030cf:	8b 45 f4             	mov    -0xc(%ebp),%eax
  1030d2:	89 04 24             	mov    %eax,(%esp)
  1030d5:	e8 b7 f8 ff ff       	call   102991 <page2pa>
  1030da:	8b 15 c0 88 11 00    	mov    0x1188c0,%edx
  1030e0:	c1 e2 0c             	shl    $0xc,%edx
  1030e3:	39 d0                	cmp    %edx,%eax
  1030e5:	72 24                	jb     10310b <basic_check+0x205>
  1030e7:	c7 44 24 0c 92 68 10 	movl   $0x106892,0xc(%esp)
  1030ee:	00 
  1030ef:	c7 44 24 08 56 67 10 	movl   $0x106756,0x8(%esp)
  1030f6:	00 
  1030f7:	c7 44 24 04 b6 00 00 	movl   $0xb6,0x4(%esp)
  1030fe:	00 
  1030ff:	c7 04 24 6b 67 10 00 	movl   $0x10676b,(%esp)
  103106:	e8 bb db ff ff       	call   100cc6 <__panic>

    list_entry_t free_list_store = free_list;
  10310b:	a1 b0 89 11 00       	mov    0x1189b0,%eax
  103110:	8b 15 b4 89 11 00    	mov    0x1189b4,%edx
  103116:	89 45 d0             	mov    %eax,-0x30(%ebp)
  103119:	89 55 d4             	mov    %edx,-0x2c(%ebp)
  10311c:	c7 45 e0 b0 89 11 00 	movl   $0x1189b0,-0x20(%ebp)
 * list_init - initialize a new entry
 * @elm:        new entry to be initialized
 * */
static inline void
list_init(list_entry_t *elm) {
    elm->prev = elm->next = elm;
  103123:	8b 45 e0             	mov    -0x20(%ebp),%eax
  103126:	8b 55 e0             	mov    -0x20(%ebp),%edx
  103129:	89 50 04             	mov    %edx,0x4(%eax)
  10312c:	8b 45 e0             	mov    -0x20(%ebp),%eax
  10312f:	8b 50 04             	mov    0x4(%eax),%edx
  103132:	8b 45 e0             	mov    -0x20(%ebp),%eax
  103135:	89 10                	mov    %edx,(%eax)
  103137:	c7 45 dc b0 89 11 00 	movl   $0x1189b0,-0x24(%ebp)
 * list_empty - tests whether a list is empty
 * @list:       the list to test.
 * */
static inline bool
list_empty(list_entry_t *list) {
    return list->next == list;
  10313e:	8b 45 dc             	mov    -0x24(%ebp),%eax
  103141:	8b 40 04             	mov    0x4(%eax),%eax
  103144:	39 45 dc             	cmp    %eax,-0x24(%ebp)
  103147:	0f 94 c0             	sete   %al
  10314a:	0f b6 c0             	movzbl %al,%eax
    list_init(&free_list);
    assert(list_empty(&free_list));
  10314d:	85 c0                	test   %eax,%eax
  10314f:	75 24                	jne    103175 <basic_check+0x26f>
  103151:	c7 44 24 0c af 68 10 	movl   $0x1068af,0xc(%esp)
  103158:	00 
  103159:	c7 44 24 08 56 67 10 	movl   $0x106756,0x8(%esp)
  103160:	00 
  103161:	c7 44 24 04 ba 00 00 	movl   $0xba,0x4(%esp)
  103168:	00 
  103169:	c7 04 24 6b 67 10 00 	movl   $0x10676b,(%esp)
  103170:	e8 51 db ff ff       	call   100cc6 <__panic>

    unsigned int nr_free_store = nr_free;
  103175:	a1 b8 89 11 00       	mov    0x1189b8,%eax
  10317a:	89 45 e8             	mov    %eax,-0x18(%ebp)
    nr_free = 0;
  10317d:	c7 05 b8 89 11 00 00 	movl   $0x0,0x1189b8
  103184:	00 00 00 

    assert(alloc_page() == NULL);
  103187:	c7 04 24 01 00 00 00 	movl   $0x1,(%esp)
  10318e:	e8 1d 0c 00 00       	call   103db0 <alloc_pages>
  103193:	85 c0                	test   %eax,%eax
  103195:	74 24                	je     1031bb <basic_check+0x2b5>
  103197:	c7 44 24 0c c6 68 10 	movl   $0x1068c6,0xc(%esp)
  10319e:	00 
  10319f:	c7 44 24 08 56 67 10 	movl   $0x106756,0x8(%esp)
  1031a6:	00 
  1031a7:	c7 44 24 04 bf 00 00 	movl   $0xbf,0x4(%esp)
  1031ae:	00 
  1031af:	c7 04 24 6b 67 10 00 	movl   $0x10676b,(%esp)
  1031b6:	e8 0b db ff ff       	call   100cc6 <__panic>

    free_page(p0);
  1031bb:	c7 44 24 04 01 00 00 	movl   $0x1,0x4(%esp)
  1031c2:	00 
  1031c3:	8b 45 ec             	mov    -0x14(%ebp),%eax
  1031c6:	89 04 24             	mov    %eax,(%esp)
  1031c9:	e8 1a 0c 00 00       	call   103de8 <free_pages>
    free_page(p1);
  1031ce:	c7 44 24 04 01 00 00 	movl   $0x1,0x4(%esp)
  1031d5:	00 
  1031d6:	8b 45 f0             	mov    -0x10(%ebp),%eax
  1031d9:	89 04 24             	mov    %eax,(%esp)
  1031dc:	e8 07 0c 00 00       	call   103de8 <free_pages>
    free_page(p2);
  1031e1:	c7 44 24 04 01 00 00 	movl   $0x1,0x4(%esp)
  1031e8:	00 
  1031e9:	8b 45 f4             	mov    -0xc(%ebp),%eax
  1031ec:	89 04 24             	mov    %eax,(%esp)
  1031ef:	e8 f4 0b 00 00       	call   103de8 <free_pages>
    assert(nr_free == 3);
  1031f4:	a1 b8 89 11 00       	mov    0x1189b8,%eax
  1031f9:	83 f8 03             	cmp    $0x3,%eax
  1031fc:	74 24                	je     103222 <basic_check+0x31c>
  1031fe:	c7 44 24 0c db 68 10 	movl   $0x1068db,0xc(%esp)
  103205:	00 
  103206:	c7 44 24 08 56 67 10 	movl   $0x106756,0x8(%esp)
  10320d:	00 
  10320e:	c7 44 24 04 c4 00 00 	movl   $0xc4,0x4(%esp)
  103215:	00 
  103216:	c7 04 24 6b 67 10 00 	movl   $0x10676b,(%esp)
  10321d:	e8 a4 da ff ff       	call   100cc6 <__panic>

    assert((p0 = alloc_page()) != NULL);
  103222:	c7 04 24 01 00 00 00 	movl   $0x1,(%esp)
  103229:	e8 82 0b 00 00       	call   103db0 <alloc_pages>
  10322e:	89 45 ec             	mov    %eax,-0x14(%ebp)
  103231:	83 7d ec 00          	cmpl   $0x0,-0x14(%ebp)
  103235:	75 24                	jne    10325b <basic_check+0x355>
  103237:	c7 44 24 0c a4 67 10 	movl   $0x1067a4,0xc(%esp)
  10323e:	00 
  10323f:	c7 44 24 08 56 67 10 	movl   $0x106756,0x8(%esp)
  103246:	00 
  103247:	c7 44 24 04 c6 00 00 	movl   $0xc6,0x4(%esp)
  10324e:	00 
  10324f:	c7 04 24 6b 67 10 00 	movl   $0x10676b,(%esp)
  103256:	e8 6b da ff ff       	call   100cc6 <__panic>
    assert((p1 = alloc_page()) != NULL);
  10325b:	c7 04 24 01 00 00 00 	movl   $0x1,(%esp)
  103262:	e8 49 0b 00 00       	call   103db0 <alloc_pages>
  103267:	89 45 f0             	mov    %eax,-0x10(%ebp)
  10326a:	83 7d f0 00          	cmpl   $0x0,-0x10(%ebp)
  10326e:	75 24                	jne    103294 <basic_check+0x38e>
  103270:	c7 44 24 0c c0 67 10 	movl   $0x1067c0,0xc(%esp)
  103277:	00 
  103278:	c7 44 24 08 56 67 10 	movl   $0x106756,0x8(%esp)
  10327f:	00 
  103280:	c7 44 24 04 c7 00 00 	movl   $0xc7,0x4(%esp)
  103287:	00 
  103288:	c7 04 24 6b 67 10 00 	movl   $0x10676b,(%esp)
  10328f:	e8 32 da ff ff       	call   100cc6 <__panic>
    assert((p2 = alloc_page()) != NULL);
  103294:	c7 04 24 01 00 00 00 	movl   $0x1,(%esp)
  10329b:	e8 10 0b 00 00       	call   103db0 <alloc_pages>
  1032a0:	89 45 f4             	mov    %eax,-0xc(%ebp)
  1032a3:	83 7d f4 00          	cmpl   $0x0,-0xc(%ebp)
  1032a7:	75 24                	jne    1032cd <basic_check+0x3c7>
  1032a9:	c7 44 24 0c dc 67 10 	movl   $0x1067dc,0xc(%esp)
  1032b0:	00 
  1032b1:	c7 44 24 08 56 67 10 	movl   $0x106756,0x8(%esp)
  1032b8:	00 
  1032b9:	c7 44 24 04 c8 00 00 	movl   $0xc8,0x4(%esp)
  1032c0:	00 
  1032c1:	c7 04 24 6b 67 10 00 	movl   $0x10676b,(%esp)
  1032c8:	e8 f9 d9 ff ff       	call   100cc6 <__panic>

    assert(alloc_page() == NULL);
  1032cd:	c7 04 24 01 00 00 00 	movl   $0x1,(%esp)
  1032d4:	e8 d7 0a 00 00       	call   103db0 <alloc_pages>
  1032d9:	85 c0                	test   %eax,%eax
  1032db:	74 24                	je     103301 <basic_check+0x3fb>
  1032dd:	c7 44 24 0c c6 68 10 	movl   $0x1068c6,0xc(%esp)
  1032e4:	00 
  1032e5:	c7 44 24 08 56 67 10 	movl   $0x106756,0x8(%esp)
  1032ec:	00 
  1032ed:	c7 44 24 04 ca 00 00 	movl   $0xca,0x4(%esp)
  1032f4:	00 
  1032f5:	c7 04 24 6b 67 10 00 	movl   $0x10676b,(%esp)
  1032fc:	e8 c5 d9 ff ff       	call   100cc6 <__panic>

    free_page(p0);
  103301:	c7 44 24 04 01 00 00 	movl   $0x1,0x4(%esp)
  103308:	00 
  103309:	8b 45 ec             	mov    -0x14(%ebp),%eax
  10330c:	89 04 24             	mov    %eax,(%esp)
  10330f:	e8 d4 0a 00 00       	call   103de8 <free_pages>
  103314:	c7 45 d8 b0 89 11 00 	movl   $0x1189b0,-0x28(%ebp)
  10331b:	8b 45 d8             	mov    -0x28(%ebp),%eax
  10331e:	8b 40 04             	mov    0x4(%eax),%eax
  103321:	39 45 d8             	cmp    %eax,-0x28(%ebp)
  103324:	0f 94 c0             	sete   %al
  103327:	0f b6 c0             	movzbl %al,%eax
    assert(!list_empty(&free_list));
  10332a:	85 c0                	test   %eax,%eax
  10332c:	74 24                	je     103352 <basic_check+0x44c>
  10332e:	c7 44 24 0c e8 68 10 	movl   $0x1068e8,0xc(%esp)
  103335:	00 
  103336:	c7 44 24 08 56 67 10 	movl   $0x106756,0x8(%esp)
  10333d:	00 
  10333e:	c7 44 24 04 cd 00 00 	movl   $0xcd,0x4(%esp)
  103345:	00 
  103346:	c7 04 24 6b 67 10 00 	movl   $0x10676b,(%esp)
  10334d:	e8 74 d9 ff ff       	call   100cc6 <__panic>

    struct Page *p;
    assert((p = alloc_page()) == p0);
  103352:	c7 04 24 01 00 00 00 	movl   $0x1,(%esp)
  103359:	e8 52 0a 00 00       	call   103db0 <alloc_pages>
  10335e:	89 45 e4             	mov    %eax,-0x1c(%ebp)
  103361:	8b 45 e4             	mov    -0x1c(%ebp),%eax
  103364:	3b 45 ec             	cmp    -0x14(%ebp),%eax
  103367:	74 24                	je     10338d <basic_check+0x487>
  103369:	c7 44 24 0c 00 69 10 	movl   $0x106900,0xc(%esp)
  103370:	00 
  103371:	c7 44 24 08 56 67 10 	movl   $0x106756,0x8(%esp)
  103378:	00 
  103379:	c7 44 24 04 d0 00 00 	movl   $0xd0,0x4(%esp)
  103380:	00 
  103381:	c7 04 24 6b 67 10 00 	movl   $0x10676b,(%esp)
  103388:	e8 39 d9 ff ff       	call   100cc6 <__panic>
    assert(alloc_page() == NULL);
  10338d:	c7 04 24 01 00 00 00 	movl   $0x1,(%esp)
  103394:	e8 17 0a 00 00       	call   103db0 <alloc_pages>
  103399:	85 c0                	test   %eax,%eax
  10339b:	74 24                	je     1033c1 <basic_check+0x4bb>
  10339d:	c7 44 24 0c c6 68 10 	movl   $0x1068c6,0xc(%esp)
  1033a4:	00 
  1033a5:	c7 44 24 08 56 67 10 	movl   $0x106756,0x8(%esp)
  1033ac:	00 
  1033ad:	c7 44 24 04 d1 00 00 	movl   $0xd1,0x4(%esp)
  1033b4:	00 
  1033b5:	c7 04 24 6b 67 10 00 	movl   $0x10676b,(%esp)
  1033bc:	e8 05 d9 ff ff       	call   100cc6 <__panic>

    assert(nr_free == 0);
  1033c1:	a1 b8 89 11 00       	mov    0x1189b8,%eax
  1033c6:	85 c0                	test   %eax,%eax
  1033c8:	74 24                	je     1033ee <basic_check+0x4e8>
  1033ca:	c7 44 24 0c 19 69 10 	movl   $0x106919,0xc(%esp)
  1033d1:	00 
  1033d2:	c7 44 24 08 56 67 10 	movl   $0x106756,0x8(%esp)
  1033d9:	00 
  1033da:	c7 44 24 04 d3 00 00 	movl   $0xd3,0x4(%esp)
  1033e1:	00 
  1033e2:	c7 04 24 6b 67 10 00 	movl   $0x10676b,(%esp)
  1033e9:	e8 d8 d8 ff ff       	call   100cc6 <__panic>
    free_list = free_list_store;
  1033ee:	8b 45 d0             	mov    -0x30(%ebp),%eax
  1033f1:	8b 55 d4             	mov    -0x2c(%ebp),%edx
  1033f4:	a3 b0 89 11 00       	mov    %eax,0x1189b0
  1033f9:	89 15 b4 89 11 00    	mov    %edx,0x1189b4
    nr_free = nr_free_store;
  1033ff:	8b 45 e8             	mov    -0x18(%ebp),%eax
  103402:	a3 b8 89 11 00       	mov    %eax,0x1189b8

    free_page(p);
  103407:	c7 44 24 04 01 00 00 	movl   $0x1,0x4(%esp)
  10340e:	00 
  10340f:	8b 45 e4             	mov    -0x1c(%ebp),%eax
  103412:	89 04 24             	mov    %eax,(%esp)
  103415:	e8 ce 09 00 00       	call   103de8 <free_pages>
    free_page(p1);
  10341a:	c7 44 24 04 01 00 00 	movl   $0x1,0x4(%esp)
  103421:	00 
  103422:	8b 45 f0             	mov    -0x10(%ebp),%eax
  103425:	89 04 24             	mov    %eax,(%esp)
  103428:	e8 bb 09 00 00       	call   103de8 <free_pages>
    free_page(p2);
  10342d:	c7 44 24 04 01 00 00 	movl   $0x1,0x4(%esp)
  103434:	00 
  103435:	8b 45 f4             	mov    -0xc(%ebp),%eax
  103438:	89 04 24             	mov    %eax,(%esp)
  10343b:	e8 a8 09 00 00       	call   103de8 <free_pages>
}
  103440:	c9                   	leave  
  103441:	c3                   	ret    

00103442 <default_check>:

// LAB2: below code is used to check the first fit allocation algorithm (your EXERCISE 1) 
// NOTICE: You SHOULD NOT CHANGE basic_check, default_check functions!
static void
default_check(void) {
  103442:	55                   	push   %ebp
  103443:	89 e5                	mov    %esp,%ebp
  103445:	53                   	push   %ebx
  103446:	81 ec 94 00 00 00    	sub    $0x94,%esp
    int count = 0, total = 0;
  10344c:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)
  103453:	c7 45 f0 00 00 00 00 	movl   $0x0,-0x10(%ebp)
    list_entry_t *le = &free_list;
  10345a:	c7 45 ec b0 89 11 00 	movl   $0x1189b0,-0x14(%ebp)
    while ((le = list_next(le)) != &free_list) {
  103461:	eb 6b                	jmp    1034ce <default_check+0x8c>
        struct Page *p = le2page(le, page_link);
  103463:	8b 45 ec             	mov    -0x14(%ebp),%eax
  103466:	83 e8 0c             	sub    $0xc,%eax
  103469:	89 45 e8             	mov    %eax,-0x18(%ebp)
        assert(PageProperty(p));
  10346c:	8b 45 e8             	mov    -0x18(%ebp),%eax
  10346f:	83 c0 04             	add    $0x4,%eax
  103472:	c7 45 d0 01 00 00 00 	movl   $0x1,-0x30(%ebp)
  103479:	89 45 cc             	mov    %eax,-0x34(%ebp)
 * @addr:   the address to count from
 * */
static inline bool
test_bit(int nr, volatile void *addr) {
    int oldbit;
    asm volatile ("btl %2, %1; sbbl %0,%0" : "=r" (oldbit) : "m" (*(volatile long *)addr), "Ir" (nr));
  10347c:	8b 45 cc             	mov    -0x34(%ebp),%eax
  10347f:	8b 55 d0             	mov    -0x30(%ebp),%edx
  103482:	0f a3 10             	bt     %edx,(%eax)
  103485:	19 c0                	sbb    %eax,%eax
  103487:	89 45 c8             	mov    %eax,-0x38(%ebp)
    return oldbit != 0;
  10348a:	83 7d c8 00          	cmpl   $0x0,-0x38(%ebp)
  10348e:	0f 95 c0             	setne  %al
  103491:	0f b6 c0             	movzbl %al,%eax
  103494:	85 c0                	test   %eax,%eax
  103496:	75 24                	jne    1034bc <default_check+0x7a>
  103498:	c7 44 24 0c 26 69 10 	movl   $0x106926,0xc(%esp)
  10349f:	00 
  1034a0:	c7 44 24 08 56 67 10 	movl   $0x106756,0x8(%esp)
  1034a7:	00 
  1034a8:	c7 44 24 04 e4 00 00 	movl   $0xe4,0x4(%esp)
  1034af:	00 
  1034b0:	c7 04 24 6b 67 10 00 	movl   $0x10676b,(%esp)
  1034b7:	e8 0a d8 ff ff       	call   100cc6 <__panic>
        count ++, total += p->property;
  1034bc:	83 45 f4 01          	addl   $0x1,-0xc(%ebp)
  1034c0:	8b 45 e8             	mov    -0x18(%ebp),%eax
  1034c3:	8b 50 08             	mov    0x8(%eax),%edx
  1034c6:	8b 45 f0             	mov    -0x10(%ebp),%eax
  1034c9:	01 d0                	add    %edx,%eax
  1034cb:	89 45 f0             	mov    %eax,-0x10(%ebp)
  1034ce:	8b 45 ec             	mov    -0x14(%ebp),%eax
  1034d1:	89 45 c4             	mov    %eax,-0x3c(%ebp)
 * list_next - get the next entry
 * @listelm:    the list head
 **/
static inline list_entry_t *
list_next(list_entry_t *listelm) {
    return listelm->next;
  1034d4:	8b 45 c4             	mov    -0x3c(%ebp),%eax
  1034d7:	8b 40 04             	mov    0x4(%eax),%eax
// NOTICE: You SHOULD NOT CHANGE basic_check, default_check functions!
static void
default_check(void) {
    int count = 0, total = 0;
    list_entry_t *le = &free_list;
    while ((le = list_next(le)) != &free_list) {
  1034da:	89 45 ec             	mov    %eax,-0x14(%ebp)
  1034dd:	81 7d ec b0 89 11 00 	cmpl   $0x1189b0,-0x14(%ebp)
  1034e4:	0f 85 79 ff ff ff    	jne    103463 <default_check+0x21>
        struct Page *p = le2page(le, page_link);
        assert(PageProperty(p));
        count ++, total += p->property;
    }
    assert(total == nr_free_pages());
  1034ea:	8b 5d f0             	mov    -0x10(%ebp),%ebx
  1034ed:	e8 28 09 00 00       	call   103e1a <nr_free_pages>
  1034f2:	39 c3                	cmp    %eax,%ebx
  1034f4:	74 24                	je     10351a <default_check+0xd8>
  1034f6:	c7 44 24 0c 36 69 10 	movl   $0x106936,0xc(%esp)
  1034fd:	00 
  1034fe:	c7 44 24 08 56 67 10 	movl   $0x106756,0x8(%esp)
  103505:	00 
  103506:	c7 44 24 04 e7 00 00 	movl   $0xe7,0x4(%esp)
  10350d:	00 
  10350e:	c7 04 24 6b 67 10 00 	movl   $0x10676b,(%esp)
  103515:	e8 ac d7 ff ff       	call   100cc6 <__panic>

    basic_check();
  10351a:	e8 e7 f9 ff ff       	call   102f06 <basic_check>

    struct Page *p0 = alloc_pages(5), *p1, *p2;
  10351f:	c7 04 24 05 00 00 00 	movl   $0x5,(%esp)
  103526:	e8 85 08 00 00       	call   103db0 <alloc_pages>
  10352b:	89 45 e4             	mov    %eax,-0x1c(%ebp)
    assert(p0 != NULL);
  10352e:	83 7d e4 00          	cmpl   $0x0,-0x1c(%ebp)
  103532:	75 24                	jne    103558 <default_check+0x116>
  103534:	c7 44 24 0c 4f 69 10 	movl   $0x10694f,0xc(%esp)
  10353b:	00 
  10353c:	c7 44 24 08 56 67 10 	movl   $0x106756,0x8(%esp)
  103543:	00 
  103544:	c7 44 24 04 ec 00 00 	movl   $0xec,0x4(%esp)
  10354b:	00 
  10354c:	c7 04 24 6b 67 10 00 	movl   $0x10676b,(%esp)
  103553:	e8 6e d7 ff ff       	call   100cc6 <__panic>
    assert(!PageProperty(p0));
  103558:	8b 45 e4             	mov    -0x1c(%ebp),%eax
  10355b:	83 c0 04             	add    $0x4,%eax
  10355e:	c7 45 c0 01 00 00 00 	movl   $0x1,-0x40(%ebp)
  103565:	89 45 bc             	mov    %eax,-0x44(%ebp)
 * @addr:   the address to count from
 * */
static inline bool
test_bit(int nr, volatile void *addr) {
    int oldbit;
    asm volatile ("btl %2, %1; sbbl %0,%0" : "=r" (oldbit) : "m" (*(volatile long *)addr), "Ir" (nr));
  103568:	8b 45 bc             	mov    -0x44(%ebp),%eax
  10356b:	8b 55 c0             	mov    -0x40(%ebp),%edx
  10356e:	0f a3 10             	bt     %edx,(%eax)
  103571:	19 c0                	sbb    %eax,%eax
  103573:	89 45 b8             	mov    %eax,-0x48(%ebp)
    return oldbit != 0;
  103576:	83 7d b8 00          	cmpl   $0x0,-0x48(%ebp)
  10357a:	0f 95 c0             	setne  %al
  10357d:	0f b6 c0             	movzbl %al,%eax
  103580:	85 c0                	test   %eax,%eax
  103582:	74 24                	je     1035a8 <default_check+0x166>
  103584:	c7 44 24 0c 5a 69 10 	movl   $0x10695a,0xc(%esp)
  10358b:	00 
  10358c:	c7 44 24 08 56 67 10 	movl   $0x106756,0x8(%esp)
  103593:	00 
  103594:	c7 44 24 04 ed 00 00 	movl   $0xed,0x4(%esp)
  10359b:	00 
  10359c:	c7 04 24 6b 67 10 00 	movl   $0x10676b,(%esp)
  1035a3:	e8 1e d7 ff ff       	call   100cc6 <__panic>

    list_entry_t free_list_store = free_list;
  1035a8:	a1 b0 89 11 00       	mov    0x1189b0,%eax
  1035ad:	8b 15 b4 89 11 00    	mov    0x1189b4,%edx
  1035b3:	89 45 80             	mov    %eax,-0x80(%ebp)
  1035b6:	89 55 84             	mov    %edx,-0x7c(%ebp)
  1035b9:	c7 45 b4 b0 89 11 00 	movl   $0x1189b0,-0x4c(%ebp)
 * list_init - initialize a new entry
 * @elm:        new entry to be initialized
 * */
static inline void
list_init(list_entry_t *elm) {
    elm->prev = elm->next = elm;
  1035c0:	8b 45 b4             	mov    -0x4c(%ebp),%eax
  1035c3:	8b 55 b4             	mov    -0x4c(%ebp),%edx
  1035c6:	89 50 04             	mov    %edx,0x4(%eax)
  1035c9:	8b 45 b4             	mov    -0x4c(%ebp),%eax
  1035cc:	8b 50 04             	mov    0x4(%eax),%edx
  1035cf:	8b 45 b4             	mov    -0x4c(%ebp),%eax
  1035d2:	89 10                	mov    %edx,(%eax)
  1035d4:	c7 45 b0 b0 89 11 00 	movl   $0x1189b0,-0x50(%ebp)
 * list_empty - tests whether a list is empty
 * @list:       the list to test.
 * */
static inline bool
list_empty(list_entry_t *list) {
    return list->next == list;
  1035db:	8b 45 b0             	mov    -0x50(%ebp),%eax
  1035de:	8b 40 04             	mov    0x4(%eax),%eax
  1035e1:	39 45 b0             	cmp    %eax,-0x50(%ebp)
  1035e4:	0f 94 c0             	sete   %al
  1035e7:	0f b6 c0             	movzbl %al,%eax
    list_init(&free_list);
    assert(list_empty(&free_list));
  1035ea:	85 c0                	test   %eax,%eax
  1035ec:	75 24                	jne    103612 <default_check+0x1d0>
  1035ee:	c7 44 24 0c af 68 10 	movl   $0x1068af,0xc(%esp)
  1035f5:	00 
  1035f6:	c7 44 24 08 56 67 10 	movl   $0x106756,0x8(%esp)
  1035fd:	00 
  1035fe:	c7 44 24 04 f1 00 00 	movl   $0xf1,0x4(%esp)
  103605:	00 
  103606:	c7 04 24 6b 67 10 00 	movl   $0x10676b,(%esp)
  10360d:	e8 b4 d6 ff ff       	call   100cc6 <__panic>
    assert(alloc_page() == NULL);
  103612:	c7 04 24 01 00 00 00 	movl   $0x1,(%esp)
  103619:	e8 92 07 00 00       	call   103db0 <alloc_pages>
  10361e:	85 c0                	test   %eax,%eax
  103620:	74 24                	je     103646 <default_check+0x204>
  103622:	c7 44 24 0c c6 68 10 	movl   $0x1068c6,0xc(%esp)
  103629:	00 
  10362a:	c7 44 24 08 56 67 10 	movl   $0x106756,0x8(%esp)
  103631:	00 
  103632:	c7 44 24 04 f2 00 00 	movl   $0xf2,0x4(%esp)
  103639:	00 
  10363a:	c7 04 24 6b 67 10 00 	movl   $0x10676b,(%esp)
  103641:	e8 80 d6 ff ff       	call   100cc6 <__panic>

    unsigned int nr_free_store = nr_free;
  103646:	a1 b8 89 11 00       	mov    0x1189b8,%eax
  10364b:	89 45 e0             	mov    %eax,-0x20(%ebp)
    nr_free = 0;
  10364e:	c7 05 b8 89 11 00 00 	movl   $0x0,0x1189b8
  103655:	00 00 00 

    free_pages(p0 + 2, 3);
  103658:	8b 45 e4             	mov    -0x1c(%ebp),%eax
  10365b:	83 c0 28             	add    $0x28,%eax
  10365e:	c7 44 24 04 03 00 00 	movl   $0x3,0x4(%esp)
  103665:	00 
  103666:	89 04 24             	mov    %eax,(%esp)
  103669:	e8 7a 07 00 00       	call   103de8 <free_pages>
    assert(alloc_pages(4) == NULL);
  10366e:	c7 04 24 04 00 00 00 	movl   $0x4,(%esp)
  103675:	e8 36 07 00 00       	call   103db0 <alloc_pages>
  10367a:	85 c0                	test   %eax,%eax
  10367c:	74 24                	je     1036a2 <default_check+0x260>
  10367e:	c7 44 24 0c 6c 69 10 	movl   $0x10696c,0xc(%esp)
  103685:	00 
  103686:	c7 44 24 08 56 67 10 	movl   $0x106756,0x8(%esp)
  10368d:	00 
  10368e:	c7 44 24 04 f8 00 00 	movl   $0xf8,0x4(%esp)
  103695:	00 
  103696:	c7 04 24 6b 67 10 00 	movl   $0x10676b,(%esp)
  10369d:	e8 24 d6 ff ff       	call   100cc6 <__panic>
    assert(PageProperty(p0 + 2) && p0[2].property == 3);
  1036a2:	8b 45 e4             	mov    -0x1c(%ebp),%eax
  1036a5:	83 c0 28             	add    $0x28,%eax
  1036a8:	83 c0 04             	add    $0x4,%eax
  1036ab:	c7 45 ac 01 00 00 00 	movl   $0x1,-0x54(%ebp)
  1036b2:	89 45 a8             	mov    %eax,-0x58(%ebp)
 * @addr:   the address to count from
 * */
static inline bool
test_bit(int nr, volatile void *addr) {
    int oldbit;
    asm volatile ("btl %2, %1; sbbl %0,%0" : "=r" (oldbit) : "m" (*(volatile long *)addr), "Ir" (nr));
  1036b5:	8b 45 a8             	mov    -0x58(%ebp),%eax
  1036b8:	8b 55 ac             	mov    -0x54(%ebp),%edx
  1036bb:	0f a3 10             	bt     %edx,(%eax)
  1036be:	19 c0                	sbb    %eax,%eax
  1036c0:	89 45 a4             	mov    %eax,-0x5c(%ebp)
    return oldbit != 0;
  1036c3:	83 7d a4 00          	cmpl   $0x0,-0x5c(%ebp)
  1036c7:	0f 95 c0             	setne  %al
  1036ca:	0f b6 c0             	movzbl %al,%eax
  1036cd:	85 c0                	test   %eax,%eax
  1036cf:	74 0e                	je     1036df <default_check+0x29d>
  1036d1:	8b 45 e4             	mov    -0x1c(%ebp),%eax
  1036d4:	83 c0 28             	add    $0x28,%eax
  1036d7:	8b 40 08             	mov    0x8(%eax),%eax
  1036da:	83 f8 03             	cmp    $0x3,%eax
  1036dd:	74 24                	je     103703 <default_check+0x2c1>
  1036df:	c7 44 24 0c 84 69 10 	movl   $0x106984,0xc(%esp)
  1036e6:	00 
  1036e7:	c7 44 24 08 56 67 10 	movl   $0x106756,0x8(%esp)
  1036ee:	00 
  1036ef:	c7 44 24 04 f9 00 00 	movl   $0xf9,0x4(%esp)
  1036f6:	00 
  1036f7:	c7 04 24 6b 67 10 00 	movl   $0x10676b,(%esp)
  1036fe:	e8 c3 d5 ff ff       	call   100cc6 <__panic>
    assert((p1 = alloc_pages(3)) != NULL);
  103703:	c7 04 24 03 00 00 00 	movl   $0x3,(%esp)
  10370a:	e8 a1 06 00 00       	call   103db0 <alloc_pages>
  10370f:	89 45 dc             	mov    %eax,-0x24(%ebp)
  103712:	83 7d dc 00          	cmpl   $0x0,-0x24(%ebp)
  103716:	75 24                	jne    10373c <default_check+0x2fa>
  103718:	c7 44 24 0c b0 69 10 	movl   $0x1069b0,0xc(%esp)
  10371f:	00 
  103720:	c7 44 24 08 56 67 10 	movl   $0x106756,0x8(%esp)
  103727:	00 
  103728:	c7 44 24 04 fa 00 00 	movl   $0xfa,0x4(%esp)
  10372f:	00 
  103730:	c7 04 24 6b 67 10 00 	movl   $0x10676b,(%esp)
  103737:	e8 8a d5 ff ff       	call   100cc6 <__panic>
    assert(alloc_page() == NULL);
  10373c:	c7 04 24 01 00 00 00 	movl   $0x1,(%esp)
  103743:	e8 68 06 00 00       	call   103db0 <alloc_pages>
  103748:	85 c0                	test   %eax,%eax
  10374a:	74 24                	je     103770 <default_check+0x32e>
  10374c:	c7 44 24 0c c6 68 10 	movl   $0x1068c6,0xc(%esp)
  103753:	00 
  103754:	c7 44 24 08 56 67 10 	movl   $0x106756,0x8(%esp)
  10375b:	00 
  10375c:	c7 44 24 04 fb 00 00 	movl   $0xfb,0x4(%esp)
  103763:	00 
  103764:	c7 04 24 6b 67 10 00 	movl   $0x10676b,(%esp)
  10376b:	e8 56 d5 ff ff       	call   100cc6 <__panic>
    assert(p0 + 2 == p1);
  103770:	8b 45 e4             	mov    -0x1c(%ebp),%eax
  103773:	83 c0 28             	add    $0x28,%eax
  103776:	3b 45 dc             	cmp    -0x24(%ebp),%eax
  103779:	74 24                	je     10379f <default_check+0x35d>
  10377b:	c7 44 24 0c ce 69 10 	movl   $0x1069ce,0xc(%esp)
  103782:	00 
  103783:	c7 44 24 08 56 67 10 	movl   $0x106756,0x8(%esp)
  10378a:	00 
  10378b:	c7 44 24 04 fc 00 00 	movl   $0xfc,0x4(%esp)
  103792:	00 
  103793:	c7 04 24 6b 67 10 00 	movl   $0x10676b,(%esp)
  10379a:	e8 27 d5 ff ff       	call   100cc6 <__panic>

    p2 = p0 + 1;
  10379f:	8b 45 e4             	mov    -0x1c(%ebp),%eax
  1037a2:	83 c0 14             	add    $0x14,%eax
  1037a5:	89 45 d8             	mov    %eax,-0x28(%ebp)
    free_page(p0);
  1037a8:	c7 44 24 04 01 00 00 	movl   $0x1,0x4(%esp)
  1037af:	00 
  1037b0:	8b 45 e4             	mov    -0x1c(%ebp),%eax
  1037b3:	89 04 24             	mov    %eax,(%esp)
  1037b6:	e8 2d 06 00 00       	call   103de8 <free_pages>
    free_pages(p1, 3);
  1037bb:	c7 44 24 04 03 00 00 	movl   $0x3,0x4(%esp)
  1037c2:	00 
  1037c3:	8b 45 dc             	mov    -0x24(%ebp),%eax
  1037c6:	89 04 24             	mov    %eax,(%esp)
  1037c9:	e8 1a 06 00 00       	call   103de8 <free_pages>
    assert(PageProperty(p0) && p0->property == 1);
  1037ce:	8b 45 e4             	mov    -0x1c(%ebp),%eax
  1037d1:	83 c0 04             	add    $0x4,%eax
  1037d4:	c7 45 a0 01 00 00 00 	movl   $0x1,-0x60(%ebp)
  1037db:	89 45 9c             	mov    %eax,-0x64(%ebp)
 * @addr:   the address to count from
 * */
static inline bool
test_bit(int nr, volatile void *addr) {
    int oldbit;
    asm volatile ("btl %2, %1; sbbl %0,%0" : "=r" (oldbit) : "m" (*(volatile long *)addr), "Ir" (nr));
  1037de:	8b 45 9c             	mov    -0x64(%ebp),%eax
  1037e1:	8b 55 a0             	mov    -0x60(%ebp),%edx
  1037e4:	0f a3 10             	bt     %edx,(%eax)
  1037e7:	19 c0                	sbb    %eax,%eax
  1037e9:	89 45 98             	mov    %eax,-0x68(%ebp)
    return oldbit != 0;
  1037ec:	83 7d 98 00          	cmpl   $0x0,-0x68(%ebp)
  1037f0:	0f 95 c0             	setne  %al
  1037f3:	0f b6 c0             	movzbl %al,%eax
  1037f6:	85 c0                	test   %eax,%eax
  1037f8:	74 0b                	je     103805 <default_check+0x3c3>
  1037fa:	8b 45 e4             	mov    -0x1c(%ebp),%eax
  1037fd:	8b 40 08             	mov    0x8(%eax),%eax
  103800:	83 f8 01             	cmp    $0x1,%eax
  103803:	74 24                	je     103829 <default_check+0x3e7>
  103805:	c7 44 24 0c dc 69 10 	movl   $0x1069dc,0xc(%esp)
  10380c:	00 
  10380d:	c7 44 24 08 56 67 10 	movl   $0x106756,0x8(%esp)
  103814:	00 
  103815:	c7 44 24 04 01 01 00 	movl   $0x101,0x4(%esp)
  10381c:	00 
  10381d:	c7 04 24 6b 67 10 00 	movl   $0x10676b,(%esp)
  103824:	e8 9d d4 ff ff       	call   100cc6 <__panic>
    assert(PageProperty(p1) && p1->property == 3);
  103829:	8b 45 dc             	mov    -0x24(%ebp),%eax
  10382c:	83 c0 04             	add    $0x4,%eax
  10382f:	c7 45 94 01 00 00 00 	movl   $0x1,-0x6c(%ebp)
  103836:	89 45 90             	mov    %eax,-0x70(%ebp)
 * @addr:   the address to count from
 * */
static inline bool
test_bit(int nr, volatile void *addr) {
    int oldbit;
    asm volatile ("btl %2, %1; sbbl %0,%0" : "=r" (oldbit) : "m" (*(volatile long *)addr), "Ir" (nr));
  103839:	8b 45 90             	mov    -0x70(%ebp),%eax
  10383c:	8b 55 94             	mov    -0x6c(%ebp),%edx
  10383f:	0f a3 10             	bt     %edx,(%eax)
  103842:	19 c0                	sbb    %eax,%eax
  103844:	89 45 8c             	mov    %eax,-0x74(%ebp)
    return oldbit != 0;
  103847:	83 7d 8c 00          	cmpl   $0x0,-0x74(%ebp)
  10384b:	0f 95 c0             	setne  %al
  10384e:	0f b6 c0             	movzbl %al,%eax
  103851:	85 c0                	test   %eax,%eax
  103853:	74 0b                	je     103860 <default_check+0x41e>
  103855:	8b 45 dc             	mov    -0x24(%ebp),%eax
  103858:	8b 40 08             	mov    0x8(%eax),%eax
  10385b:	83 f8 03             	cmp    $0x3,%eax
  10385e:	74 24                	je     103884 <default_check+0x442>
  103860:	c7 44 24 0c 04 6a 10 	movl   $0x106a04,0xc(%esp)
  103867:	00 
  103868:	c7 44 24 08 56 67 10 	movl   $0x106756,0x8(%esp)
  10386f:	00 
  103870:	c7 44 24 04 02 01 00 	movl   $0x102,0x4(%esp)
  103877:	00 
  103878:	c7 04 24 6b 67 10 00 	movl   $0x10676b,(%esp)
  10387f:	e8 42 d4 ff ff       	call   100cc6 <__panic>

    assert((p0 = alloc_page()) == p2 - 1);
  103884:	c7 04 24 01 00 00 00 	movl   $0x1,(%esp)
  10388b:	e8 20 05 00 00       	call   103db0 <alloc_pages>
  103890:	89 45 e4             	mov    %eax,-0x1c(%ebp)
  103893:	8b 45 d8             	mov    -0x28(%ebp),%eax
  103896:	83 e8 14             	sub    $0x14,%eax
  103899:	39 45 e4             	cmp    %eax,-0x1c(%ebp)
  10389c:	74 24                	je     1038c2 <default_check+0x480>
  10389e:	c7 44 24 0c 2a 6a 10 	movl   $0x106a2a,0xc(%esp)
  1038a5:	00 
  1038a6:	c7 44 24 08 56 67 10 	movl   $0x106756,0x8(%esp)
  1038ad:	00 
  1038ae:	c7 44 24 04 04 01 00 	movl   $0x104,0x4(%esp)
  1038b5:	00 
  1038b6:	c7 04 24 6b 67 10 00 	movl   $0x10676b,(%esp)
  1038bd:	e8 04 d4 ff ff       	call   100cc6 <__panic>
    free_page(p0);
  1038c2:	c7 44 24 04 01 00 00 	movl   $0x1,0x4(%esp)
  1038c9:	00 
  1038ca:	8b 45 e4             	mov    -0x1c(%ebp),%eax
  1038cd:	89 04 24             	mov    %eax,(%esp)
  1038d0:	e8 13 05 00 00       	call   103de8 <free_pages>
    assert((p0 = alloc_pages(2)) == p2 + 1);
  1038d5:	c7 04 24 02 00 00 00 	movl   $0x2,(%esp)
  1038dc:	e8 cf 04 00 00       	call   103db0 <alloc_pages>
  1038e1:	89 45 e4             	mov    %eax,-0x1c(%ebp)
  1038e4:	8b 45 d8             	mov    -0x28(%ebp),%eax
  1038e7:	83 c0 14             	add    $0x14,%eax
  1038ea:	39 45 e4             	cmp    %eax,-0x1c(%ebp)
  1038ed:	74 24                	je     103913 <default_check+0x4d1>
  1038ef:	c7 44 24 0c 48 6a 10 	movl   $0x106a48,0xc(%esp)
  1038f6:	00 
  1038f7:	c7 44 24 08 56 67 10 	movl   $0x106756,0x8(%esp)
  1038fe:	00 
  1038ff:	c7 44 24 04 06 01 00 	movl   $0x106,0x4(%esp)
  103906:	00 
  103907:	c7 04 24 6b 67 10 00 	movl   $0x10676b,(%esp)
  10390e:	e8 b3 d3 ff ff       	call   100cc6 <__panic>

    free_pages(p0, 2);
  103913:	c7 44 24 04 02 00 00 	movl   $0x2,0x4(%esp)
  10391a:	00 
  10391b:	8b 45 e4             	mov    -0x1c(%ebp),%eax
  10391e:	89 04 24             	mov    %eax,(%esp)
  103921:	e8 c2 04 00 00       	call   103de8 <free_pages>
    free_page(p2);
  103926:	c7 44 24 04 01 00 00 	movl   $0x1,0x4(%esp)
  10392d:	00 
  10392e:	8b 45 d8             	mov    -0x28(%ebp),%eax
  103931:	89 04 24             	mov    %eax,(%esp)
  103934:	e8 af 04 00 00       	call   103de8 <free_pages>

    assert((p0 = alloc_pages(5)) != NULL);
  103939:	c7 04 24 05 00 00 00 	movl   $0x5,(%esp)
  103940:	e8 6b 04 00 00       	call   103db0 <alloc_pages>
  103945:	89 45 e4             	mov    %eax,-0x1c(%ebp)
  103948:	83 7d e4 00          	cmpl   $0x0,-0x1c(%ebp)
  10394c:	75 24                	jne    103972 <default_check+0x530>
  10394e:	c7 44 24 0c 68 6a 10 	movl   $0x106a68,0xc(%esp)
  103955:	00 
  103956:	c7 44 24 08 56 67 10 	movl   $0x106756,0x8(%esp)
  10395d:	00 
  10395e:	c7 44 24 04 0b 01 00 	movl   $0x10b,0x4(%esp)
  103965:	00 
  103966:	c7 04 24 6b 67 10 00 	movl   $0x10676b,(%esp)
  10396d:	e8 54 d3 ff ff       	call   100cc6 <__panic>
    assert(alloc_page() == NULL);
  103972:	c7 04 24 01 00 00 00 	movl   $0x1,(%esp)
  103979:	e8 32 04 00 00       	call   103db0 <alloc_pages>
  10397e:	85 c0                	test   %eax,%eax
  103980:	74 24                	je     1039a6 <default_check+0x564>
  103982:	c7 44 24 0c c6 68 10 	movl   $0x1068c6,0xc(%esp)
  103989:	00 
  10398a:	c7 44 24 08 56 67 10 	movl   $0x106756,0x8(%esp)
  103991:	00 
  103992:	c7 44 24 04 0c 01 00 	movl   $0x10c,0x4(%esp)
  103999:	00 
  10399a:	c7 04 24 6b 67 10 00 	movl   $0x10676b,(%esp)
  1039a1:	e8 20 d3 ff ff       	call   100cc6 <__panic>

    assert(nr_free == 0);
  1039a6:	a1 b8 89 11 00       	mov    0x1189b8,%eax
  1039ab:	85 c0                	test   %eax,%eax
  1039ad:	74 24                	je     1039d3 <default_check+0x591>
  1039af:	c7 44 24 0c 19 69 10 	movl   $0x106919,0xc(%esp)
  1039b6:	00 
  1039b7:	c7 44 24 08 56 67 10 	movl   $0x106756,0x8(%esp)
  1039be:	00 
  1039bf:	c7 44 24 04 0e 01 00 	movl   $0x10e,0x4(%esp)
  1039c6:	00 
  1039c7:	c7 04 24 6b 67 10 00 	movl   $0x10676b,(%esp)
  1039ce:	e8 f3 d2 ff ff       	call   100cc6 <__panic>
    nr_free = nr_free_store;
  1039d3:	8b 45 e0             	mov    -0x20(%ebp),%eax
  1039d6:	a3 b8 89 11 00       	mov    %eax,0x1189b8

    free_list = free_list_store;
  1039db:	8b 45 80             	mov    -0x80(%ebp),%eax
  1039de:	8b 55 84             	mov    -0x7c(%ebp),%edx
  1039e1:	a3 b0 89 11 00       	mov    %eax,0x1189b0
  1039e6:	89 15 b4 89 11 00    	mov    %edx,0x1189b4
    free_pages(p0, 5);
  1039ec:	c7 44 24 04 05 00 00 	movl   $0x5,0x4(%esp)
  1039f3:	00 
  1039f4:	8b 45 e4             	mov    -0x1c(%ebp),%eax
  1039f7:	89 04 24             	mov    %eax,(%esp)
  1039fa:	e8 e9 03 00 00       	call   103de8 <free_pages>

    le = &free_list;
  1039ff:	c7 45 ec b0 89 11 00 	movl   $0x1189b0,-0x14(%ebp)
    while ((le = list_next(le)) != &free_list) {
  103a06:	eb 1d                	jmp    103a25 <default_check+0x5e3>
        struct Page *p = le2page(le, page_link);
  103a08:	8b 45 ec             	mov    -0x14(%ebp),%eax
  103a0b:	83 e8 0c             	sub    $0xc,%eax
  103a0e:	89 45 d4             	mov    %eax,-0x2c(%ebp)
        count --, total -= p->property;
  103a11:	83 6d f4 01          	subl   $0x1,-0xc(%ebp)
  103a15:	8b 55 f0             	mov    -0x10(%ebp),%edx
  103a18:	8b 45 d4             	mov    -0x2c(%ebp),%eax
  103a1b:	8b 40 08             	mov    0x8(%eax),%eax
  103a1e:	29 c2                	sub    %eax,%edx
  103a20:	89 d0                	mov    %edx,%eax
  103a22:	89 45 f0             	mov    %eax,-0x10(%ebp)
  103a25:	8b 45 ec             	mov    -0x14(%ebp),%eax
  103a28:	89 45 88             	mov    %eax,-0x78(%ebp)
 * list_next - get the next entry
 * @listelm:    the list head
 **/
static inline list_entry_t *
list_next(list_entry_t *listelm) {
    return listelm->next;
  103a2b:	8b 45 88             	mov    -0x78(%ebp),%eax
  103a2e:	8b 40 04             	mov    0x4(%eax),%eax

    free_list = free_list_store;
    free_pages(p0, 5);

    le = &free_list;
    while ((le = list_next(le)) != &free_list) {
  103a31:	89 45 ec             	mov    %eax,-0x14(%ebp)
  103a34:	81 7d ec b0 89 11 00 	cmpl   $0x1189b0,-0x14(%ebp)
  103a3b:	75 cb                	jne    103a08 <default_check+0x5c6>
        struct Page *p = le2page(le, page_link);
        count --, total -= p->property;
    }
    assert(count == 0);
  103a3d:	83 7d f4 00          	cmpl   $0x0,-0xc(%ebp)
  103a41:	74 24                	je     103a67 <default_check+0x625>
  103a43:	c7 44 24 0c 86 6a 10 	movl   $0x106a86,0xc(%esp)
  103a4a:	00 
  103a4b:	c7 44 24 08 56 67 10 	movl   $0x106756,0x8(%esp)
  103a52:	00 
  103a53:	c7 44 24 04 19 01 00 	movl   $0x119,0x4(%esp)
  103a5a:	00 
  103a5b:	c7 04 24 6b 67 10 00 	movl   $0x10676b,(%esp)
  103a62:	e8 5f d2 ff ff       	call   100cc6 <__panic>
    assert(total == 0);
  103a67:	83 7d f0 00          	cmpl   $0x0,-0x10(%ebp)
  103a6b:	74 24                	je     103a91 <default_check+0x64f>
  103a6d:	c7 44 24 0c 91 6a 10 	movl   $0x106a91,0xc(%esp)
  103a74:	00 
  103a75:	c7 44 24 08 56 67 10 	movl   $0x106756,0x8(%esp)
  103a7c:	00 
  103a7d:	c7 44 24 04 1a 01 00 	movl   $0x11a,0x4(%esp)
  103a84:	00 
  103a85:	c7 04 24 6b 67 10 00 	movl   $0x10676b,(%esp)
  103a8c:	e8 35 d2 ff ff       	call   100cc6 <__panic>
}
  103a91:	81 c4 94 00 00 00    	add    $0x94,%esp
  103a97:	5b                   	pop    %ebx
  103a98:	5d                   	pop    %ebp
  103a99:	c3                   	ret    

00103a9a <page2ppn>:

extern struct Page *pages;
extern size_t npage;

static inline ppn_t
page2ppn(struct Page *page) {
  103a9a:	55                   	push   %ebp
  103a9b:	89 e5                	mov    %esp,%ebp
    return page - pages;
  103a9d:	8b 55 08             	mov    0x8(%ebp),%edx
  103aa0:	a1 c4 89 11 00       	mov    0x1189c4,%eax
  103aa5:	29 c2                	sub    %eax,%edx
  103aa7:	89 d0                	mov    %edx,%eax
  103aa9:	c1 f8 02             	sar    $0x2,%eax
  103aac:	69 c0 cd cc cc cc    	imul   $0xcccccccd,%eax,%eax
}
  103ab2:	5d                   	pop    %ebp
  103ab3:	c3                   	ret    

00103ab4 <page2pa>:

static inline uintptr_t
page2pa(struct Page *page) {
  103ab4:	55                   	push   %ebp
  103ab5:	89 e5                	mov    %esp,%ebp
  103ab7:	83 ec 04             	sub    $0x4,%esp
    return page2ppn(page) << PGSHIFT;
  103aba:	8b 45 08             	mov    0x8(%ebp),%eax
  103abd:	89 04 24             	mov    %eax,(%esp)
  103ac0:	e8 d5 ff ff ff       	call   103a9a <page2ppn>
  103ac5:	c1 e0 0c             	shl    $0xc,%eax
}
  103ac8:	c9                   	leave  
  103ac9:	c3                   	ret    

00103aca <pa2page>:

static inline struct Page *
pa2page(uintptr_t pa) {
  103aca:	55                   	push   %ebp
  103acb:	89 e5                	mov    %esp,%ebp
  103acd:	83 ec 18             	sub    $0x18,%esp
    if (PPN(pa) >= npage) {
  103ad0:	8b 45 08             	mov    0x8(%ebp),%eax
  103ad3:	c1 e8 0c             	shr    $0xc,%eax
  103ad6:	89 c2                	mov    %eax,%edx
  103ad8:	a1 c0 88 11 00       	mov    0x1188c0,%eax
  103add:	39 c2                	cmp    %eax,%edx
  103adf:	72 1c                	jb     103afd <pa2page+0x33>
        panic("pa2page called with invalid pa");
  103ae1:	c7 44 24 08 cc 6a 10 	movl   $0x106acc,0x8(%esp)
  103ae8:	00 
  103ae9:	c7 44 24 04 5a 00 00 	movl   $0x5a,0x4(%esp)
  103af0:	00 
  103af1:	c7 04 24 eb 6a 10 00 	movl   $0x106aeb,(%esp)
  103af8:	e8 c9 d1 ff ff       	call   100cc6 <__panic>
    }
    return &pages[PPN(pa)];
  103afd:	8b 0d c4 89 11 00    	mov    0x1189c4,%ecx
  103b03:	8b 45 08             	mov    0x8(%ebp),%eax
  103b06:	c1 e8 0c             	shr    $0xc,%eax
  103b09:	89 c2                	mov    %eax,%edx
  103b0b:	89 d0                	mov    %edx,%eax
  103b0d:	c1 e0 02             	shl    $0x2,%eax
  103b10:	01 d0                	add    %edx,%eax
  103b12:	c1 e0 02             	shl    $0x2,%eax
  103b15:	01 c8                	add    %ecx,%eax
}
  103b17:	c9                   	leave  
  103b18:	c3                   	ret    

00103b19 <page2kva>:

static inline void *
page2kva(struct Page *page) {
  103b19:	55                   	push   %ebp
  103b1a:	89 e5                	mov    %esp,%ebp
  103b1c:	83 ec 28             	sub    $0x28,%esp
    return KADDR(page2pa(page));
  103b1f:	8b 45 08             	mov    0x8(%ebp),%eax
  103b22:	89 04 24             	mov    %eax,(%esp)
  103b25:	e8 8a ff ff ff       	call   103ab4 <page2pa>
  103b2a:	89 45 f4             	mov    %eax,-0xc(%ebp)
  103b2d:	8b 45 f4             	mov    -0xc(%ebp),%eax
  103b30:	c1 e8 0c             	shr    $0xc,%eax
  103b33:	89 45 f0             	mov    %eax,-0x10(%ebp)
  103b36:	a1 c0 88 11 00       	mov    0x1188c0,%eax
  103b3b:	39 45 f0             	cmp    %eax,-0x10(%ebp)
  103b3e:	72 23                	jb     103b63 <page2kva+0x4a>
  103b40:	8b 45 f4             	mov    -0xc(%ebp),%eax
  103b43:	89 44 24 0c          	mov    %eax,0xc(%esp)
  103b47:	c7 44 24 08 fc 6a 10 	movl   $0x106afc,0x8(%esp)
  103b4e:	00 
  103b4f:	c7 44 24 04 61 00 00 	movl   $0x61,0x4(%esp)
  103b56:	00 
  103b57:	c7 04 24 eb 6a 10 00 	movl   $0x106aeb,(%esp)
  103b5e:	e8 63 d1 ff ff       	call   100cc6 <__panic>
  103b63:	8b 45 f4             	mov    -0xc(%ebp),%eax
  103b66:	2d 00 00 00 40       	sub    $0x40000000,%eax
}
  103b6b:	c9                   	leave  
  103b6c:	c3                   	ret    

00103b6d <pte2page>:
kva2page(void *kva) {
    return pa2page(PADDR(kva));
}

static inline struct Page *
pte2page(pte_t pte) {
  103b6d:	55                   	push   %ebp
  103b6e:	89 e5                	mov    %esp,%ebp
  103b70:	83 ec 18             	sub    $0x18,%esp
    if (!(pte & PTE_P)) {
  103b73:	8b 45 08             	mov    0x8(%ebp),%eax
  103b76:	83 e0 01             	and    $0x1,%eax
  103b79:	85 c0                	test   %eax,%eax
  103b7b:	75 1c                	jne    103b99 <pte2page+0x2c>
        panic("pte2page called with invalid pte");
  103b7d:	c7 44 24 08 20 6b 10 	movl   $0x106b20,0x8(%esp)
  103b84:	00 
  103b85:	c7 44 24 04 6c 00 00 	movl   $0x6c,0x4(%esp)
  103b8c:	00 
  103b8d:	c7 04 24 eb 6a 10 00 	movl   $0x106aeb,(%esp)
  103b94:	e8 2d d1 ff ff       	call   100cc6 <__panic>
    }
    return pa2page(PTE_ADDR(pte));
  103b99:	8b 45 08             	mov    0x8(%ebp),%eax
  103b9c:	25 00 f0 ff ff       	and    $0xfffff000,%eax
  103ba1:	89 04 24             	mov    %eax,(%esp)
  103ba4:	e8 21 ff ff ff       	call   103aca <pa2page>
}
  103ba9:	c9                   	leave  
  103baa:	c3                   	ret    

00103bab <page_ref>:
pde2page(pde_t pde) {
    return pa2page(PDE_ADDR(pde));
}

static inline int
page_ref(struct Page *page) {
  103bab:	55                   	push   %ebp
  103bac:	89 e5                	mov    %esp,%ebp
    return page->ref;
  103bae:	8b 45 08             	mov    0x8(%ebp),%eax
  103bb1:	8b 00                	mov    (%eax),%eax
}
  103bb3:	5d                   	pop    %ebp
  103bb4:	c3                   	ret    

00103bb5 <set_page_ref>:

static inline void
set_page_ref(struct Page *page, int val) {
  103bb5:	55                   	push   %ebp
  103bb6:	89 e5                	mov    %esp,%ebp
    page->ref = val;
  103bb8:	8b 45 08             	mov    0x8(%ebp),%eax
  103bbb:	8b 55 0c             	mov    0xc(%ebp),%edx
  103bbe:	89 10                	mov    %edx,(%eax)
}
  103bc0:	5d                   	pop    %ebp
  103bc1:	c3                   	ret    

00103bc2 <page_ref_inc>:

static inline int
page_ref_inc(struct Page *page) {
  103bc2:	55                   	push   %ebp
  103bc3:	89 e5                	mov    %esp,%ebp
    page->ref += 1;
  103bc5:	8b 45 08             	mov    0x8(%ebp),%eax
  103bc8:	8b 00                	mov    (%eax),%eax
  103bca:	8d 50 01             	lea    0x1(%eax),%edx
  103bcd:	8b 45 08             	mov    0x8(%ebp),%eax
  103bd0:	89 10                	mov    %edx,(%eax)
    return page->ref;
  103bd2:	8b 45 08             	mov    0x8(%ebp),%eax
  103bd5:	8b 00                	mov    (%eax),%eax
}
  103bd7:	5d                   	pop    %ebp
  103bd8:	c3                   	ret    

00103bd9 <page_ref_dec>:

static inline int
page_ref_dec(struct Page *page) {
  103bd9:	55                   	push   %ebp
  103bda:	89 e5                	mov    %esp,%ebp
    page->ref -= 1;
  103bdc:	8b 45 08             	mov    0x8(%ebp),%eax
  103bdf:	8b 00                	mov    (%eax),%eax
  103be1:	8d 50 ff             	lea    -0x1(%eax),%edx
  103be4:	8b 45 08             	mov    0x8(%ebp),%eax
  103be7:	89 10                	mov    %edx,(%eax)
    return page->ref;
  103be9:	8b 45 08             	mov    0x8(%ebp),%eax
  103bec:	8b 00                	mov    (%eax),%eax
}
  103bee:	5d                   	pop    %ebp
  103bef:	c3                   	ret    

00103bf0 <__intr_save>:
#include <x86.h>
#include <intr.h>
#include <mmu.h>

static inline bool
__intr_save(void) {
  103bf0:	55                   	push   %ebp
  103bf1:	89 e5                	mov    %esp,%ebp
  103bf3:	83 ec 18             	sub    $0x18,%esp
}

static inline uint32_t
read_eflags(void) {
    uint32_t eflags;
    asm volatile ("pushfl; popl %0" : "=r" (eflags));
  103bf6:	9c                   	pushf  
  103bf7:	58                   	pop    %eax
  103bf8:	89 45 f4             	mov    %eax,-0xc(%ebp)
    return eflags;
  103bfb:	8b 45 f4             	mov    -0xc(%ebp),%eax
    if (read_eflags() & FL_IF) {
  103bfe:	25 00 02 00 00       	and    $0x200,%eax
  103c03:	85 c0                	test   %eax,%eax
  103c05:	74 0c                	je     103c13 <__intr_save+0x23>
        intr_disable();
  103c07:	e8 9d da ff ff       	call   1016a9 <intr_disable>
        return 1;
  103c0c:	b8 01 00 00 00       	mov    $0x1,%eax
  103c11:	eb 05                	jmp    103c18 <__intr_save+0x28>
    }
    return 0;
  103c13:	b8 00 00 00 00       	mov    $0x0,%eax
}
  103c18:	c9                   	leave  
  103c19:	c3                   	ret    

00103c1a <__intr_restore>:

static inline void
__intr_restore(bool flag) {
  103c1a:	55                   	push   %ebp
  103c1b:	89 e5                	mov    %esp,%ebp
  103c1d:	83 ec 08             	sub    $0x8,%esp
    if (flag) {
  103c20:	83 7d 08 00          	cmpl   $0x0,0x8(%ebp)
  103c24:	74 05                	je     103c2b <__intr_restore+0x11>
        intr_enable();
  103c26:	e8 78 da ff ff       	call   1016a3 <intr_enable>
    }
}
  103c2b:	c9                   	leave  
  103c2c:	c3                   	ret    

00103c2d <lgdt>:
/* *
 * lgdt - load the global descriptor table register and reset the
 * data/code segement registers for kernel.
 * */
static inline void
lgdt(struct pseudodesc *pd) {
  103c2d:	55                   	push   %ebp
  103c2e:	89 e5                	mov    %esp,%ebp
    asm volatile ("lgdt (%0)" :: "r" (pd));
  103c30:	8b 45 08             	mov    0x8(%ebp),%eax
  103c33:	0f 01 10             	lgdtl  (%eax)
    asm volatile ("movw %%ax, %%gs" :: "a" (USER_DS));
  103c36:	b8 23 00 00 00       	mov    $0x23,%eax
  103c3b:	8e e8                	mov    %eax,%gs
    asm volatile ("movw %%ax, %%fs" :: "a" (USER_DS));
  103c3d:	b8 23 00 00 00       	mov    $0x23,%eax
  103c42:	8e e0                	mov    %eax,%fs
    asm volatile ("movw %%ax, %%es" :: "a" (KERNEL_DS));
  103c44:	b8 10 00 00 00       	mov    $0x10,%eax
  103c49:	8e c0                	mov    %eax,%es
    asm volatile ("movw %%ax, %%ds" :: "a" (KERNEL_DS));
  103c4b:	b8 10 00 00 00       	mov    $0x10,%eax
  103c50:	8e d8                	mov    %eax,%ds
    asm volatile ("movw %%ax, %%ss" :: "a" (KERNEL_DS));
  103c52:	b8 10 00 00 00       	mov    $0x10,%eax
  103c57:	8e d0                	mov    %eax,%ss
    // reload cs
    asm volatile ("ljmp %0, $1f\n 1:\n" :: "i" (KERNEL_CS));
  103c59:	ea 60 3c 10 00 08 00 	ljmp   $0x8,$0x103c60
}
  103c60:	5d                   	pop    %ebp
  103c61:	c3                   	ret    

00103c62 <load_esp0>:
 * load_esp0 - change the ESP0 in default task state segment,
 * so that we can use different kernel stack when we trap frame
 * user to kernel.
 * */
void
load_esp0(uintptr_t esp0) {
  103c62:	55                   	push   %ebp
  103c63:	89 e5                	mov    %esp,%ebp
    ts.ts_esp0 = esp0;
  103c65:	8b 45 08             	mov    0x8(%ebp),%eax
  103c68:	a3 e4 88 11 00       	mov    %eax,0x1188e4
}
  103c6d:	5d                   	pop    %ebp
  103c6e:	c3                   	ret    

00103c6f <gdt_init>:

/* gdt_init - initialize the default GDT and TSS */
static void
gdt_init(void) {
  103c6f:	55                   	push   %ebp
  103c70:	89 e5                	mov    %esp,%ebp
  103c72:	83 ec 14             	sub    $0x14,%esp
    // set boot kernel stack and default SS0
    load_esp0((uintptr_t)bootstacktop);
  103c75:	b8 00 70 11 00       	mov    $0x117000,%eax
  103c7a:	89 04 24             	mov    %eax,(%esp)
  103c7d:	e8 e0 ff ff ff       	call   103c62 <load_esp0>
    ts.ts_ss0 = KERNEL_DS;
  103c82:	66 c7 05 e8 88 11 00 	movw   $0x10,0x1188e8
  103c89:	10 00 

    // initialize the TSS filed of the gdt
    gdt[SEG_TSS] = SEGTSS(STS_T32A, (uintptr_t)&ts, sizeof(ts), DPL_KERNEL);
  103c8b:	66 c7 05 28 7a 11 00 	movw   $0x68,0x117a28
  103c92:	68 00 
  103c94:	b8 e0 88 11 00       	mov    $0x1188e0,%eax
  103c99:	66 a3 2a 7a 11 00    	mov    %ax,0x117a2a
  103c9f:	b8 e0 88 11 00       	mov    $0x1188e0,%eax
  103ca4:	c1 e8 10             	shr    $0x10,%eax
  103ca7:	a2 2c 7a 11 00       	mov    %al,0x117a2c
  103cac:	0f b6 05 2d 7a 11 00 	movzbl 0x117a2d,%eax
  103cb3:	83 e0 f0             	and    $0xfffffff0,%eax
  103cb6:	83 c8 09             	or     $0x9,%eax
  103cb9:	a2 2d 7a 11 00       	mov    %al,0x117a2d
  103cbe:	0f b6 05 2d 7a 11 00 	movzbl 0x117a2d,%eax
  103cc5:	83 e0 ef             	and    $0xffffffef,%eax
  103cc8:	a2 2d 7a 11 00       	mov    %al,0x117a2d
  103ccd:	0f b6 05 2d 7a 11 00 	movzbl 0x117a2d,%eax
  103cd4:	83 e0 9f             	and    $0xffffff9f,%eax
  103cd7:	a2 2d 7a 11 00       	mov    %al,0x117a2d
  103cdc:	0f b6 05 2d 7a 11 00 	movzbl 0x117a2d,%eax
  103ce3:	83 c8 80             	or     $0xffffff80,%eax
  103ce6:	a2 2d 7a 11 00       	mov    %al,0x117a2d
  103ceb:	0f b6 05 2e 7a 11 00 	movzbl 0x117a2e,%eax
  103cf2:	83 e0 f0             	and    $0xfffffff0,%eax
  103cf5:	a2 2e 7a 11 00       	mov    %al,0x117a2e
  103cfa:	0f b6 05 2e 7a 11 00 	movzbl 0x117a2e,%eax
  103d01:	83 e0 ef             	and    $0xffffffef,%eax
  103d04:	a2 2e 7a 11 00       	mov    %al,0x117a2e
  103d09:	0f b6 05 2e 7a 11 00 	movzbl 0x117a2e,%eax
  103d10:	83 e0 df             	and    $0xffffffdf,%eax
  103d13:	a2 2e 7a 11 00       	mov    %al,0x117a2e
  103d18:	0f b6 05 2e 7a 11 00 	movzbl 0x117a2e,%eax
  103d1f:	83 c8 40             	or     $0x40,%eax
  103d22:	a2 2e 7a 11 00       	mov    %al,0x117a2e
  103d27:	0f b6 05 2e 7a 11 00 	movzbl 0x117a2e,%eax
  103d2e:	83 e0 7f             	and    $0x7f,%eax
  103d31:	a2 2e 7a 11 00       	mov    %al,0x117a2e
  103d36:	b8 e0 88 11 00       	mov    $0x1188e0,%eax
  103d3b:	c1 e8 18             	shr    $0x18,%eax
  103d3e:	a2 2f 7a 11 00       	mov    %al,0x117a2f

    // reload all segment registers
    lgdt(&gdt_pd);
  103d43:	c7 04 24 30 7a 11 00 	movl   $0x117a30,(%esp)
  103d4a:	e8 de fe ff ff       	call   103c2d <lgdt>
  103d4f:	66 c7 45 fe 28 00    	movw   $0x28,-0x2(%ebp)
    asm volatile ("cli" ::: "memory");
}

static inline void
ltr(uint16_t sel) {
    asm volatile ("ltr %0" :: "r" (sel) : "memory");
  103d55:	0f b7 45 fe          	movzwl -0x2(%ebp),%eax
  103d59:	0f 00 d8             	ltr    %ax

    // load the TSS
    ltr(GD_TSS);
}
  103d5c:	c9                   	leave  
  103d5d:	c3                   	ret    

00103d5e <init_pmm_manager>:

//init_pmm_manager - initialize a pmm_manager instance
static void
init_pmm_manager(void) {
  103d5e:	55                   	push   %ebp
  103d5f:	89 e5                	mov    %esp,%ebp
  103d61:	83 ec 18             	sub    $0x18,%esp
    pmm_manager = &default_pmm_manager;
  103d64:	c7 05 bc 89 11 00 b0 	movl   $0x106ab0,0x1189bc
  103d6b:	6a 10 00 
    cprintf("memory management: %s\n", pmm_manager->name);
  103d6e:	a1 bc 89 11 00       	mov    0x1189bc,%eax
  103d73:	8b 00                	mov    (%eax),%eax
  103d75:	89 44 24 04          	mov    %eax,0x4(%esp)
  103d79:	c7 04 24 4c 6b 10 00 	movl   $0x106b4c,(%esp)
  103d80:	e8 b7 c5 ff ff       	call   10033c <cprintf>
    pmm_manager->init();
  103d85:	a1 bc 89 11 00       	mov    0x1189bc,%eax
  103d8a:	8b 40 04             	mov    0x4(%eax),%eax
  103d8d:	ff d0                	call   *%eax
}
  103d8f:	c9                   	leave  
  103d90:	c3                   	ret    

00103d91 <init_memmap>:

//init_memmap - call pmm->init_memmap to build Page struct for free memory  
static void
init_memmap(struct Page *base, size_t n) {
  103d91:	55                   	push   %ebp
  103d92:	89 e5                	mov    %esp,%ebp
  103d94:	83 ec 18             	sub    $0x18,%esp
    pmm_manager->init_memmap(base, n);
  103d97:	a1 bc 89 11 00       	mov    0x1189bc,%eax
  103d9c:	8b 40 08             	mov    0x8(%eax),%eax
  103d9f:	8b 55 0c             	mov    0xc(%ebp),%edx
  103da2:	89 54 24 04          	mov    %edx,0x4(%esp)
  103da6:	8b 55 08             	mov    0x8(%ebp),%edx
  103da9:	89 14 24             	mov    %edx,(%esp)
  103dac:	ff d0                	call   *%eax
}
  103dae:	c9                   	leave  
  103daf:	c3                   	ret    

00103db0 <alloc_pages>:

//alloc_pages - call pmm->alloc_pages to allocate a continuous n*PAGESIZE memory 
struct Page *
alloc_pages(size_t n) {
  103db0:	55                   	push   %ebp
  103db1:	89 e5                	mov    %esp,%ebp
  103db3:	83 ec 28             	sub    $0x28,%esp
    struct Page *page=NULL;
  103db6:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)
    bool intr_flag;
    local_intr_save(intr_flag);
  103dbd:	e8 2e fe ff ff       	call   103bf0 <__intr_save>
  103dc2:	89 45 f0             	mov    %eax,-0x10(%ebp)
    {
        page = pmm_manager->alloc_pages(n);
  103dc5:	a1 bc 89 11 00       	mov    0x1189bc,%eax
  103dca:	8b 40 0c             	mov    0xc(%eax),%eax
  103dcd:	8b 55 08             	mov    0x8(%ebp),%edx
  103dd0:	89 14 24             	mov    %edx,(%esp)
  103dd3:	ff d0                	call   *%eax
  103dd5:	89 45 f4             	mov    %eax,-0xc(%ebp)
    }
    local_intr_restore(intr_flag);
  103dd8:	8b 45 f0             	mov    -0x10(%ebp),%eax
  103ddb:	89 04 24             	mov    %eax,(%esp)
  103dde:	e8 37 fe ff ff       	call   103c1a <__intr_restore>
    return page;
  103de3:	8b 45 f4             	mov    -0xc(%ebp),%eax
}
  103de6:	c9                   	leave  
  103de7:	c3                   	ret    

00103de8 <free_pages>:

//free_pages - call pmm->free_pages to free a continuous n*PAGESIZE memory 
void
free_pages(struct Page *base, size_t n) {
  103de8:	55                   	push   %ebp
  103de9:	89 e5                	mov    %esp,%ebp
  103deb:	83 ec 28             	sub    $0x28,%esp
    bool intr_flag;
    local_intr_save(intr_flag);
  103dee:	e8 fd fd ff ff       	call   103bf0 <__intr_save>
  103df3:	89 45 f4             	mov    %eax,-0xc(%ebp)
    {
        pmm_manager->free_pages(base, n);
  103df6:	a1 bc 89 11 00       	mov    0x1189bc,%eax
  103dfb:	8b 40 10             	mov    0x10(%eax),%eax
  103dfe:	8b 55 0c             	mov    0xc(%ebp),%edx
  103e01:	89 54 24 04          	mov    %edx,0x4(%esp)
  103e05:	8b 55 08             	mov    0x8(%ebp),%edx
  103e08:	89 14 24             	mov    %edx,(%esp)
  103e0b:	ff d0                	call   *%eax
    }
    local_intr_restore(intr_flag);
  103e0d:	8b 45 f4             	mov    -0xc(%ebp),%eax
  103e10:	89 04 24             	mov    %eax,(%esp)
  103e13:	e8 02 fe ff ff       	call   103c1a <__intr_restore>
}
  103e18:	c9                   	leave  
  103e19:	c3                   	ret    

00103e1a <nr_free_pages>:

//nr_free_pages - call pmm->nr_free_pages to get the size (nr*PAGESIZE) 
//of current free memory
size_t
nr_free_pages(void) {
  103e1a:	55                   	push   %ebp
  103e1b:	89 e5                	mov    %esp,%ebp
  103e1d:	83 ec 28             	sub    $0x28,%esp
    size_t ret;
    bool intr_flag;
    local_intr_save(intr_flag);
  103e20:	e8 cb fd ff ff       	call   103bf0 <__intr_save>
  103e25:	89 45 f4             	mov    %eax,-0xc(%ebp)
    {
        ret = pmm_manager->nr_free_pages();
  103e28:	a1 bc 89 11 00       	mov    0x1189bc,%eax
  103e2d:	8b 40 14             	mov    0x14(%eax),%eax
  103e30:	ff d0                	call   *%eax
  103e32:	89 45 f0             	mov    %eax,-0x10(%ebp)
    }
    local_intr_restore(intr_flag);
  103e35:	8b 45 f4             	mov    -0xc(%ebp),%eax
  103e38:	89 04 24             	mov    %eax,(%esp)
  103e3b:	e8 da fd ff ff       	call   103c1a <__intr_restore>
    return ret;
  103e40:	8b 45 f0             	mov    -0x10(%ebp),%eax
}
  103e43:	c9                   	leave  
  103e44:	c3                   	ret    

00103e45 <page_init>:

/* pmm_init - initialize the physical memory management */
static void
page_init(void) {
  103e45:	55                   	push   %ebp
  103e46:	89 e5                	mov    %esp,%ebp
  103e48:	57                   	push   %edi
  103e49:	56                   	push   %esi
  103e4a:	53                   	push   %ebx
  103e4b:	81 ec 9c 00 00 00    	sub    $0x9c,%esp
    struct e820map *memmap = (struct e820map *)(0x8000 + KERNBASE);
  103e51:	c7 45 c4 00 80 00 c0 	movl   $0xc0008000,-0x3c(%ebp)
    uint64_t maxpa = 0;
  103e58:	c7 45 e0 00 00 00 00 	movl   $0x0,-0x20(%ebp)
  103e5f:	c7 45 e4 00 00 00 00 	movl   $0x0,-0x1c(%ebp)

    cprintf("e820map:\n");
  103e66:	c7 04 24 63 6b 10 00 	movl   $0x106b63,(%esp)
  103e6d:	e8 ca c4 ff ff       	call   10033c <cprintf>
    int i;
    for (i = 0; i < memmap->nr_map; i ++) {
  103e72:	c7 45 dc 00 00 00 00 	movl   $0x0,-0x24(%ebp)
  103e79:	e9 15 01 00 00       	jmp    103f93 <page_init+0x14e>
        uint64_t begin = memmap->map[i].addr, end = begin + memmap->map[i].size;
  103e7e:	8b 4d c4             	mov    -0x3c(%ebp),%ecx
  103e81:	8b 55 dc             	mov    -0x24(%ebp),%edx
  103e84:	89 d0                	mov    %edx,%eax
  103e86:	c1 e0 02             	shl    $0x2,%eax
  103e89:	01 d0                	add    %edx,%eax
  103e8b:	c1 e0 02             	shl    $0x2,%eax
  103e8e:	01 c8                	add    %ecx,%eax
  103e90:	8b 50 08             	mov    0x8(%eax),%edx
  103e93:	8b 40 04             	mov    0x4(%eax),%eax
  103e96:	89 45 b8             	mov    %eax,-0x48(%ebp)
  103e99:	89 55 bc             	mov    %edx,-0x44(%ebp)
  103e9c:	8b 4d c4             	mov    -0x3c(%ebp),%ecx
  103e9f:	8b 55 dc             	mov    -0x24(%ebp),%edx
  103ea2:	89 d0                	mov    %edx,%eax
  103ea4:	c1 e0 02             	shl    $0x2,%eax
  103ea7:	01 d0                	add    %edx,%eax
  103ea9:	c1 e0 02             	shl    $0x2,%eax
  103eac:	01 c8                	add    %ecx,%eax
  103eae:	8b 48 0c             	mov    0xc(%eax),%ecx
  103eb1:	8b 58 10             	mov    0x10(%eax),%ebx
  103eb4:	8b 45 b8             	mov    -0x48(%ebp),%eax
  103eb7:	8b 55 bc             	mov    -0x44(%ebp),%edx
  103eba:	01 c8                	add    %ecx,%eax
  103ebc:	11 da                	adc    %ebx,%edx
  103ebe:	89 45 b0             	mov    %eax,-0x50(%ebp)
  103ec1:	89 55 b4             	mov    %edx,-0x4c(%ebp)
        cprintf("  memory: %08llx, [%08llx, %08llx], type = %d.\n",
  103ec4:	8b 4d c4             	mov    -0x3c(%ebp),%ecx
  103ec7:	8b 55 dc             	mov    -0x24(%ebp),%edx
  103eca:	89 d0                	mov    %edx,%eax
  103ecc:	c1 e0 02             	shl    $0x2,%eax
  103ecf:	01 d0                	add    %edx,%eax
  103ed1:	c1 e0 02             	shl    $0x2,%eax
  103ed4:	01 c8                	add    %ecx,%eax
  103ed6:	83 c0 14             	add    $0x14,%eax
  103ed9:	8b 00                	mov    (%eax),%eax
  103edb:	89 85 7c ff ff ff    	mov    %eax,-0x84(%ebp)
  103ee1:	8b 45 b0             	mov    -0x50(%ebp),%eax
  103ee4:	8b 55 b4             	mov    -0x4c(%ebp),%edx
  103ee7:	83 c0 ff             	add    $0xffffffff,%eax
  103eea:	83 d2 ff             	adc    $0xffffffff,%edx
  103eed:	89 c6                	mov    %eax,%esi
  103eef:	89 d7                	mov    %edx,%edi
  103ef1:	8b 4d c4             	mov    -0x3c(%ebp),%ecx
  103ef4:	8b 55 dc             	mov    -0x24(%ebp),%edx
  103ef7:	89 d0                	mov    %edx,%eax
  103ef9:	c1 e0 02             	shl    $0x2,%eax
  103efc:	01 d0                	add    %edx,%eax
  103efe:	c1 e0 02             	shl    $0x2,%eax
  103f01:	01 c8                	add    %ecx,%eax
  103f03:	8b 48 0c             	mov    0xc(%eax),%ecx
  103f06:	8b 58 10             	mov    0x10(%eax),%ebx
  103f09:	8b 85 7c ff ff ff    	mov    -0x84(%ebp),%eax
  103f0f:	89 44 24 1c          	mov    %eax,0x1c(%esp)
  103f13:	89 74 24 14          	mov    %esi,0x14(%esp)
  103f17:	89 7c 24 18          	mov    %edi,0x18(%esp)
  103f1b:	8b 45 b8             	mov    -0x48(%ebp),%eax
  103f1e:	8b 55 bc             	mov    -0x44(%ebp),%edx
  103f21:	89 44 24 0c          	mov    %eax,0xc(%esp)
  103f25:	89 54 24 10          	mov    %edx,0x10(%esp)
  103f29:	89 4c 24 04          	mov    %ecx,0x4(%esp)
  103f2d:	89 5c 24 08          	mov    %ebx,0x8(%esp)
  103f31:	c7 04 24 70 6b 10 00 	movl   $0x106b70,(%esp)
  103f38:	e8 ff c3 ff ff       	call   10033c <cprintf>
                memmap->map[i].size, begin, end - 1, memmap->map[i].type);
        if (memmap->map[i].type == E820_ARM) {
  103f3d:	8b 4d c4             	mov    -0x3c(%ebp),%ecx
  103f40:	8b 55 dc             	mov    -0x24(%ebp),%edx
  103f43:	89 d0                	mov    %edx,%eax
  103f45:	c1 e0 02             	shl    $0x2,%eax
  103f48:	01 d0                	add    %edx,%eax
  103f4a:	c1 e0 02             	shl    $0x2,%eax
  103f4d:	01 c8                	add    %ecx,%eax
  103f4f:	83 c0 14             	add    $0x14,%eax
  103f52:	8b 00                	mov    (%eax),%eax
  103f54:	83 f8 01             	cmp    $0x1,%eax
  103f57:	75 36                	jne    103f8f <page_init+0x14a>
            if (maxpa < end && begin < KMEMSIZE) {
  103f59:	8b 45 e0             	mov    -0x20(%ebp),%eax
  103f5c:	8b 55 e4             	mov    -0x1c(%ebp),%edx
  103f5f:	3b 55 b4             	cmp    -0x4c(%ebp),%edx
  103f62:	77 2b                	ja     103f8f <page_init+0x14a>
  103f64:	3b 55 b4             	cmp    -0x4c(%ebp),%edx
  103f67:	72 05                	jb     103f6e <page_init+0x129>
  103f69:	3b 45 b0             	cmp    -0x50(%ebp),%eax
  103f6c:	73 21                	jae    103f8f <page_init+0x14a>
  103f6e:	83 7d bc 00          	cmpl   $0x0,-0x44(%ebp)
  103f72:	77 1b                	ja     103f8f <page_init+0x14a>
  103f74:	83 7d bc 00          	cmpl   $0x0,-0x44(%ebp)
  103f78:	72 09                	jb     103f83 <page_init+0x13e>
  103f7a:	81 7d b8 ff ff ff 37 	cmpl   $0x37ffffff,-0x48(%ebp)
  103f81:	77 0c                	ja     103f8f <page_init+0x14a>
                maxpa = end;
  103f83:	8b 45 b0             	mov    -0x50(%ebp),%eax
  103f86:	8b 55 b4             	mov    -0x4c(%ebp),%edx
  103f89:	89 45 e0             	mov    %eax,-0x20(%ebp)
  103f8c:	89 55 e4             	mov    %edx,-0x1c(%ebp)
    struct e820map *memmap = (struct e820map *)(0x8000 + KERNBASE);
    uint64_t maxpa = 0;

    cprintf("e820map:\n");
    int i;
    for (i = 0; i < memmap->nr_map; i ++) {
  103f8f:	83 45 dc 01          	addl   $0x1,-0x24(%ebp)
  103f93:	8b 45 c4             	mov    -0x3c(%ebp),%eax
  103f96:	8b 00                	mov    (%eax),%eax
  103f98:	3b 45 dc             	cmp    -0x24(%ebp),%eax
  103f9b:	0f 8f dd fe ff ff    	jg     103e7e <page_init+0x39>
            if (maxpa < end && begin < KMEMSIZE) {
                maxpa = end;
            }
        }
    }
    if (maxpa > KMEMSIZE) {
  103fa1:	83 7d e4 00          	cmpl   $0x0,-0x1c(%ebp)
  103fa5:	72 1d                	jb     103fc4 <page_init+0x17f>
  103fa7:	83 7d e4 00          	cmpl   $0x0,-0x1c(%ebp)
  103fab:	77 09                	ja     103fb6 <page_init+0x171>
  103fad:	81 7d e0 00 00 00 38 	cmpl   $0x38000000,-0x20(%ebp)
  103fb4:	76 0e                	jbe    103fc4 <page_init+0x17f>
        maxpa = KMEMSIZE;
  103fb6:	c7 45 e0 00 00 00 38 	movl   $0x38000000,-0x20(%ebp)
  103fbd:	c7 45 e4 00 00 00 00 	movl   $0x0,-0x1c(%ebp)
    }

    extern char end[];

    npage = maxpa / PGSIZE;
  103fc4:	8b 45 e0             	mov    -0x20(%ebp),%eax
  103fc7:	8b 55 e4             	mov    -0x1c(%ebp),%edx
  103fca:	0f ac d0 0c          	shrd   $0xc,%edx,%eax
  103fce:	c1 ea 0c             	shr    $0xc,%edx
  103fd1:	a3 c0 88 11 00       	mov    %eax,0x1188c0
    pages = (struct Page *)ROUNDUP((void *)end, PGSIZE);
  103fd6:	c7 45 ac 00 10 00 00 	movl   $0x1000,-0x54(%ebp)
  103fdd:	b8 c8 89 11 00       	mov    $0x1189c8,%eax
  103fe2:	8d 50 ff             	lea    -0x1(%eax),%edx
  103fe5:	8b 45 ac             	mov    -0x54(%ebp),%eax
  103fe8:	01 d0                	add    %edx,%eax
  103fea:	89 45 a8             	mov    %eax,-0x58(%ebp)
  103fed:	8b 45 a8             	mov    -0x58(%ebp),%eax
  103ff0:	ba 00 00 00 00       	mov    $0x0,%edx
  103ff5:	f7 75 ac             	divl   -0x54(%ebp)
  103ff8:	89 d0                	mov    %edx,%eax
  103ffa:	8b 55 a8             	mov    -0x58(%ebp),%edx
  103ffd:	29 c2                	sub    %eax,%edx
  103fff:	89 d0                	mov    %edx,%eax
  104001:	a3 c4 89 11 00       	mov    %eax,0x1189c4

    for (i = 0; i < npage; i ++) {
  104006:	c7 45 dc 00 00 00 00 	movl   $0x0,-0x24(%ebp)
  10400d:	eb 2f                	jmp    10403e <page_init+0x1f9>
        SetPageReserved(pages + i);
  10400f:	8b 0d c4 89 11 00    	mov    0x1189c4,%ecx
  104015:	8b 55 dc             	mov    -0x24(%ebp),%edx
  104018:	89 d0                	mov    %edx,%eax
  10401a:	c1 e0 02             	shl    $0x2,%eax
  10401d:	01 d0                	add    %edx,%eax
  10401f:	c1 e0 02             	shl    $0x2,%eax
  104022:	01 c8                	add    %ecx,%eax
  104024:	83 c0 04             	add    $0x4,%eax
  104027:	c7 45 90 00 00 00 00 	movl   $0x0,-0x70(%ebp)
  10402e:	89 45 8c             	mov    %eax,-0x74(%ebp)
 * Note that @nr may be almost arbitrarily large; this function is not
 * restricted to acting on a single-word quantity.
 * */
static inline void
set_bit(int nr, volatile void *addr) {
    asm volatile ("btsl %1, %0" :"=m" (*(volatile long *)addr) : "Ir" (nr));
  104031:	8b 45 8c             	mov    -0x74(%ebp),%eax
  104034:	8b 55 90             	mov    -0x70(%ebp),%edx
  104037:	0f ab 10             	bts    %edx,(%eax)
    extern char end[];

    npage = maxpa / PGSIZE;
    pages = (struct Page *)ROUNDUP((void *)end, PGSIZE);

    for (i = 0; i < npage; i ++) {
  10403a:	83 45 dc 01          	addl   $0x1,-0x24(%ebp)
  10403e:	8b 55 dc             	mov    -0x24(%ebp),%edx
  104041:	a1 c0 88 11 00       	mov    0x1188c0,%eax
  104046:	39 c2                	cmp    %eax,%edx
  104048:	72 c5                	jb     10400f <page_init+0x1ca>
        SetPageReserved(pages + i);
    }

    uintptr_t freemem = PADDR((uintptr_t)pages + sizeof(struct Page) * npage);
  10404a:	8b 15 c0 88 11 00    	mov    0x1188c0,%edx
  104050:	89 d0                	mov    %edx,%eax
  104052:	c1 e0 02             	shl    $0x2,%eax
  104055:	01 d0                	add    %edx,%eax
  104057:	c1 e0 02             	shl    $0x2,%eax
  10405a:	89 c2                	mov    %eax,%edx
  10405c:	a1 c4 89 11 00       	mov    0x1189c4,%eax
  104061:	01 d0                	add    %edx,%eax
  104063:	89 45 a4             	mov    %eax,-0x5c(%ebp)
  104066:	81 7d a4 ff ff ff bf 	cmpl   $0xbfffffff,-0x5c(%ebp)
  10406d:	77 23                	ja     104092 <page_init+0x24d>
  10406f:	8b 45 a4             	mov    -0x5c(%ebp),%eax
  104072:	89 44 24 0c          	mov    %eax,0xc(%esp)
  104076:	c7 44 24 08 a0 6b 10 	movl   $0x106ba0,0x8(%esp)
  10407d:	00 
  10407e:	c7 44 24 04 db 00 00 	movl   $0xdb,0x4(%esp)
  104085:	00 
  104086:	c7 04 24 c4 6b 10 00 	movl   $0x106bc4,(%esp)
  10408d:	e8 34 cc ff ff       	call   100cc6 <__panic>
  104092:	8b 45 a4             	mov    -0x5c(%ebp),%eax
  104095:	05 00 00 00 40       	add    $0x40000000,%eax
  10409a:	89 45 a0             	mov    %eax,-0x60(%ebp)

    for (i = 0; i < memmap->nr_map; i ++) {
  10409d:	c7 45 dc 00 00 00 00 	movl   $0x0,-0x24(%ebp)
  1040a4:	e9 74 01 00 00       	jmp    10421d <page_init+0x3d8>
        uint64_t begin = memmap->map[i].addr, end = begin + memmap->map[i].size;
  1040a9:	8b 4d c4             	mov    -0x3c(%ebp),%ecx
  1040ac:	8b 55 dc             	mov    -0x24(%ebp),%edx
  1040af:	89 d0                	mov    %edx,%eax
  1040b1:	c1 e0 02             	shl    $0x2,%eax
  1040b4:	01 d0                	add    %edx,%eax
  1040b6:	c1 e0 02             	shl    $0x2,%eax
  1040b9:	01 c8                	add    %ecx,%eax
  1040bb:	8b 50 08             	mov    0x8(%eax),%edx
  1040be:	8b 40 04             	mov    0x4(%eax),%eax
  1040c1:	89 45 d0             	mov    %eax,-0x30(%ebp)
  1040c4:	89 55 d4             	mov    %edx,-0x2c(%ebp)
  1040c7:	8b 4d c4             	mov    -0x3c(%ebp),%ecx
  1040ca:	8b 55 dc             	mov    -0x24(%ebp),%edx
  1040cd:	89 d0                	mov    %edx,%eax
  1040cf:	c1 e0 02             	shl    $0x2,%eax
  1040d2:	01 d0                	add    %edx,%eax
  1040d4:	c1 e0 02             	shl    $0x2,%eax
  1040d7:	01 c8                	add    %ecx,%eax
  1040d9:	8b 48 0c             	mov    0xc(%eax),%ecx
  1040dc:	8b 58 10             	mov    0x10(%eax),%ebx
  1040df:	8b 45 d0             	mov    -0x30(%ebp),%eax
  1040e2:	8b 55 d4             	mov    -0x2c(%ebp),%edx
  1040e5:	01 c8                	add    %ecx,%eax
  1040e7:	11 da                	adc    %ebx,%edx
  1040e9:	89 45 c8             	mov    %eax,-0x38(%ebp)
  1040ec:	89 55 cc             	mov    %edx,-0x34(%ebp)
        if (memmap->map[i].type == E820_ARM) {
  1040ef:	8b 4d c4             	mov    -0x3c(%ebp),%ecx
  1040f2:	8b 55 dc             	mov    -0x24(%ebp),%edx
  1040f5:	89 d0                	mov    %edx,%eax
  1040f7:	c1 e0 02             	shl    $0x2,%eax
  1040fa:	01 d0                	add    %edx,%eax
  1040fc:	c1 e0 02             	shl    $0x2,%eax
  1040ff:	01 c8                	add    %ecx,%eax
  104101:	83 c0 14             	add    $0x14,%eax
  104104:	8b 00                	mov    (%eax),%eax
  104106:	83 f8 01             	cmp    $0x1,%eax
  104109:	0f 85 0a 01 00 00    	jne    104219 <page_init+0x3d4>
            if (begin < freemem) {
  10410f:	8b 45 a0             	mov    -0x60(%ebp),%eax
  104112:	ba 00 00 00 00       	mov    $0x0,%edx
  104117:	3b 55 d4             	cmp    -0x2c(%ebp),%edx
  10411a:	72 17                	jb     104133 <page_init+0x2ee>
  10411c:	3b 55 d4             	cmp    -0x2c(%ebp),%edx
  10411f:	77 05                	ja     104126 <page_init+0x2e1>
  104121:	3b 45 d0             	cmp    -0x30(%ebp),%eax
  104124:	76 0d                	jbe    104133 <page_init+0x2ee>
                begin = freemem;
  104126:	8b 45 a0             	mov    -0x60(%ebp),%eax
  104129:	89 45 d0             	mov    %eax,-0x30(%ebp)
  10412c:	c7 45 d4 00 00 00 00 	movl   $0x0,-0x2c(%ebp)
            }
            if (end > KMEMSIZE) {
  104133:	83 7d cc 00          	cmpl   $0x0,-0x34(%ebp)
  104137:	72 1d                	jb     104156 <page_init+0x311>
  104139:	83 7d cc 00          	cmpl   $0x0,-0x34(%ebp)
  10413d:	77 09                	ja     104148 <page_init+0x303>
  10413f:	81 7d c8 00 00 00 38 	cmpl   $0x38000000,-0x38(%ebp)
  104146:	76 0e                	jbe    104156 <page_init+0x311>
                end = KMEMSIZE;
  104148:	c7 45 c8 00 00 00 38 	movl   $0x38000000,-0x38(%ebp)
  10414f:	c7 45 cc 00 00 00 00 	movl   $0x0,-0x34(%ebp)
            }
            if (begin < end) {
  104156:	8b 45 d0             	mov    -0x30(%ebp),%eax
  104159:	8b 55 d4             	mov    -0x2c(%ebp),%edx
  10415c:	3b 55 cc             	cmp    -0x34(%ebp),%edx
  10415f:	0f 87 b4 00 00 00    	ja     104219 <page_init+0x3d4>
  104165:	3b 55 cc             	cmp    -0x34(%ebp),%edx
  104168:	72 09                	jb     104173 <page_init+0x32e>
  10416a:	3b 45 c8             	cmp    -0x38(%ebp),%eax
  10416d:	0f 83 a6 00 00 00    	jae    104219 <page_init+0x3d4>
                begin = ROUNDUP(begin, PGSIZE);
  104173:	c7 45 9c 00 10 00 00 	movl   $0x1000,-0x64(%ebp)
  10417a:	8b 55 d0             	mov    -0x30(%ebp),%edx
  10417d:	8b 45 9c             	mov    -0x64(%ebp),%eax
  104180:	01 d0                	add    %edx,%eax
  104182:	83 e8 01             	sub    $0x1,%eax
  104185:	89 45 98             	mov    %eax,-0x68(%ebp)
  104188:	8b 45 98             	mov    -0x68(%ebp),%eax
  10418b:	ba 00 00 00 00       	mov    $0x0,%edx
  104190:	f7 75 9c             	divl   -0x64(%ebp)
  104193:	89 d0                	mov    %edx,%eax
  104195:	8b 55 98             	mov    -0x68(%ebp),%edx
  104198:	29 c2                	sub    %eax,%edx
  10419a:	89 d0                	mov    %edx,%eax
  10419c:	ba 00 00 00 00       	mov    $0x0,%edx
  1041a1:	89 45 d0             	mov    %eax,-0x30(%ebp)
  1041a4:	89 55 d4             	mov    %edx,-0x2c(%ebp)
                end = ROUNDDOWN(end, PGSIZE);
  1041a7:	8b 45 c8             	mov    -0x38(%ebp),%eax
  1041aa:	89 45 94             	mov    %eax,-0x6c(%ebp)
  1041ad:	8b 45 94             	mov    -0x6c(%ebp),%eax
  1041b0:	ba 00 00 00 00       	mov    $0x0,%edx
  1041b5:	89 c7                	mov    %eax,%edi
  1041b7:	81 e7 00 f0 ff ff    	and    $0xfffff000,%edi
  1041bd:	89 7d 80             	mov    %edi,-0x80(%ebp)
  1041c0:	89 d0                	mov    %edx,%eax
  1041c2:	83 e0 00             	and    $0x0,%eax
  1041c5:	89 45 84             	mov    %eax,-0x7c(%ebp)
  1041c8:	8b 45 80             	mov    -0x80(%ebp),%eax
  1041cb:	8b 55 84             	mov    -0x7c(%ebp),%edx
  1041ce:	89 45 c8             	mov    %eax,-0x38(%ebp)
  1041d1:	89 55 cc             	mov    %edx,-0x34(%ebp)
                if (begin < end) {
  1041d4:	8b 45 d0             	mov    -0x30(%ebp),%eax
  1041d7:	8b 55 d4             	mov    -0x2c(%ebp),%edx
  1041da:	3b 55 cc             	cmp    -0x34(%ebp),%edx
  1041dd:	77 3a                	ja     104219 <page_init+0x3d4>
  1041df:	3b 55 cc             	cmp    -0x34(%ebp),%edx
  1041e2:	72 05                	jb     1041e9 <page_init+0x3a4>
  1041e4:	3b 45 c8             	cmp    -0x38(%ebp),%eax
  1041e7:	73 30                	jae    104219 <page_init+0x3d4>
                    init_memmap(pa2page(begin), (end - begin) / PGSIZE);
  1041e9:	8b 4d d0             	mov    -0x30(%ebp),%ecx
  1041ec:	8b 5d d4             	mov    -0x2c(%ebp),%ebx
  1041ef:	8b 45 c8             	mov    -0x38(%ebp),%eax
  1041f2:	8b 55 cc             	mov    -0x34(%ebp),%edx
  1041f5:	29 c8                	sub    %ecx,%eax
  1041f7:	19 da                	sbb    %ebx,%edx
  1041f9:	0f ac d0 0c          	shrd   $0xc,%edx,%eax
  1041fd:	c1 ea 0c             	shr    $0xc,%edx
  104200:	89 c3                	mov    %eax,%ebx
  104202:	8b 45 d0             	mov    -0x30(%ebp),%eax
  104205:	89 04 24             	mov    %eax,(%esp)
  104208:	e8 bd f8 ff ff       	call   103aca <pa2page>
  10420d:	89 5c 24 04          	mov    %ebx,0x4(%esp)
  104211:	89 04 24             	mov    %eax,(%esp)
  104214:	e8 78 fb ff ff       	call   103d91 <init_memmap>
        SetPageReserved(pages + i);
    }

    uintptr_t freemem = PADDR((uintptr_t)pages + sizeof(struct Page) * npage);

    for (i = 0; i < memmap->nr_map; i ++) {
  104219:	83 45 dc 01          	addl   $0x1,-0x24(%ebp)
  10421d:	8b 45 c4             	mov    -0x3c(%ebp),%eax
  104220:	8b 00                	mov    (%eax),%eax
  104222:	3b 45 dc             	cmp    -0x24(%ebp),%eax
  104225:	0f 8f 7e fe ff ff    	jg     1040a9 <page_init+0x264>
                    init_memmap(pa2page(begin), (end - begin) / PGSIZE);
                }
            }
        }
    }
}
  10422b:	81 c4 9c 00 00 00    	add    $0x9c,%esp
  104231:	5b                   	pop    %ebx
  104232:	5e                   	pop    %esi
  104233:	5f                   	pop    %edi
  104234:	5d                   	pop    %ebp
  104235:	c3                   	ret    

00104236 <enable_paging>:

static void
enable_paging(void) {
  104236:	55                   	push   %ebp
  104237:	89 e5                	mov    %esp,%ebp
  104239:	83 ec 10             	sub    $0x10,%esp
    lcr3(boot_cr3);
  10423c:	a1 c0 89 11 00       	mov    0x1189c0,%eax
  104241:	89 45 f8             	mov    %eax,-0x8(%ebp)
    asm volatile ("mov %0, %%cr0" :: "r" (cr0) : "memory");
}

static inline void
lcr3(uintptr_t cr3) {
    asm volatile ("mov %0, %%cr3" :: "r" (cr3) : "memory");
  104244:	8b 45 f8             	mov    -0x8(%ebp),%eax
  104247:	0f 22 d8             	mov    %eax,%cr3
}

static inline uintptr_t
rcr0(void) {
    uintptr_t cr0;
    asm volatile ("mov %%cr0, %0" : "=r" (cr0) :: "memory");
  10424a:	0f 20 c0             	mov    %cr0,%eax
  10424d:	89 45 f4             	mov    %eax,-0xc(%ebp)
    return cr0;
  104250:	8b 45 f4             	mov    -0xc(%ebp),%eax

    // turn on paging
    uint32_t cr0 = rcr0();
  104253:	89 45 fc             	mov    %eax,-0x4(%ebp)
    cr0 |= CR0_PE | CR0_PG | CR0_AM | CR0_WP | CR0_NE | CR0_TS | CR0_EM | CR0_MP;
  104256:	81 4d fc 2f 00 05 80 	orl    $0x8005002f,-0x4(%ebp)
    cr0 &= ~(CR0_TS | CR0_EM);
  10425d:	83 65 fc f3          	andl   $0xfffffff3,-0x4(%ebp)
  104261:	8b 45 fc             	mov    -0x4(%ebp),%eax
  104264:	89 45 f0             	mov    %eax,-0x10(%ebp)
    asm volatile ("pushl %0; popfl" :: "r" (eflags));
}

static inline void
lcr0(uintptr_t cr0) {
    asm volatile ("mov %0, %%cr0" :: "r" (cr0) : "memory");
  104267:	8b 45 f0             	mov    -0x10(%ebp),%eax
  10426a:	0f 22 c0             	mov    %eax,%cr0
    lcr0(cr0);
}
  10426d:	c9                   	leave  
  10426e:	c3                   	ret    

0010426f <boot_map_segment>:
//  la:   linear address of this memory need to map (after x86 segment map)
//  size: memory size
//  pa:   physical address of this memory
//  perm: permission of this memory  
static void
boot_map_segment(pde_t *pgdir, uintptr_t la, size_t size, uintptr_t pa, uint32_t perm) {
  10426f:	55                   	push   %ebp
  104270:	89 e5                	mov    %esp,%ebp
  104272:	83 ec 38             	sub    $0x38,%esp
    assert(PGOFF(la) == PGOFF(pa));
  104275:	8b 45 14             	mov    0x14(%ebp),%eax
  104278:	8b 55 0c             	mov    0xc(%ebp),%edx
  10427b:	31 d0                	xor    %edx,%eax
  10427d:	25 ff 0f 00 00       	and    $0xfff,%eax
  104282:	85 c0                	test   %eax,%eax
  104284:	74 24                	je     1042aa <boot_map_segment+0x3b>
  104286:	c7 44 24 0c d2 6b 10 	movl   $0x106bd2,0xc(%esp)
  10428d:	00 
  10428e:	c7 44 24 08 e9 6b 10 	movl   $0x106be9,0x8(%esp)
  104295:	00 
  104296:	c7 44 24 04 04 01 00 	movl   $0x104,0x4(%esp)
  10429d:	00 
  10429e:	c7 04 24 c4 6b 10 00 	movl   $0x106bc4,(%esp)
  1042a5:	e8 1c ca ff ff       	call   100cc6 <__panic>
    size_t n = ROUNDUP(size + PGOFF(la), PGSIZE) / PGSIZE;
  1042aa:	c7 45 f0 00 10 00 00 	movl   $0x1000,-0x10(%ebp)
  1042b1:	8b 45 0c             	mov    0xc(%ebp),%eax
  1042b4:	25 ff 0f 00 00       	and    $0xfff,%eax
  1042b9:	89 c2                	mov    %eax,%edx
  1042bb:	8b 45 10             	mov    0x10(%ebp),%eax
  1042be:	01 c2                	add    %eax,%edx
  1042c0:	8b 45 f0             	mov    -0x10(%ebp),%eax
  1042c3:	01 d0                	add    %edx,%eax
  1042c5:	83 e8 01             	sub    $0x1,%eax
  1042c8:	89 45 ec             	mov    %eax,-0x14(%ebp)
  1042cb:	8b 45 ec             	mov    -0x14(%ebp),%eax
  1042ce:	ba 00 00 00 00       	mov    $0x0,%edx
  1042d3:	f7 75 f0             	divl   -0x10(%ebp)
  1042d6:	89 d0                	mov    %edx,%eax
  1042d8:	8b 55 ec             	mov    -0x14(%ebp),%edx
  1042db:	29 c2                	sub    %eax,%edx
  1042dd:	89 d0                	mov    %edx,%eax
  1042df:	c1 e8 0c             	shr    $0xc,%eax
  1042e2:	89 45 f4             	mov    %eax,-0xc(%ebp)
    la = ROUNDDOWN(la, PGSIZE);
  1042e5:	8b 45 0c             	mov    0xc(%ebp),%eax
  1042e8:	89 45 e8             	mov    %eax,-0x18(%ebp)
  1042eb:	8b 45 e8             	mov    -0x18(%ebp),%eax
  1042ee:	25 00 f0 ff ff       	and    $0xfffff000,%eax
  1042f3:	89 45 0c             	mov    %eax,0xc(%ebp)
    pa = ROUNDDOWN(pa, PGSIZE);
  1042f6:	8b 45 14             	mov    0x14(%ebp),%eax
  1042f9:	89 45 e4             	mov    %eax,-0x1c(%ebp)
  1042fc:	8b 45 e4             	mov    -0x1c(%ebp),%eax
  1042ff:	25 00 f0 ff ff       	and    $0xfffff000,%eax
  104304:	89 45 14             	mov    %eax,0x14(%ebp)
    for (; n > 0; n --, la += PGSIZE, pa += PGSIZE) {
  104307:	eb 6b                	jmp    104374 <boot_map_segment+0x105>
        pte_t *ptep = get_pte(pgdir, la, 1);
  104309:	c7 44 24 08 01 00 00 	movl   $0x1,0x8(%esp)
  104310:	00 
  104311:	8b 45 0c             	mov    0xc(%ebp),%eax
  104314:	89 44 24 04          	mov    %eax,0x4(%esp)
  104318:	8b 45 08             	mov    0x8(%ebp),%eax
  10431b:	89 04 24             	mov    %eax,(%esp)
  10431e:	e8 cc 01 00 00       	call   1044ef <get_pte>
  104323:	89 45 e0             	mov    %eax,-0x20(%ebp)
        assert(ptep != NULL);
  104326:	83 7d e0 00          	cmpl   $0x0,-0x20(%ebp)
  10432a:	75 24                	jne    104350 <boot_map_segment+0xe1>
  10432c:	c7 44 24 0c fe 6b 10 	movl   $0x106bfe,0xc(%esp)
  104333:	00 
  104334:	c7 44 24 08 e9 6b 10 	movl   $0x106be9,0x8(%esp)
  10433b:	00 
  10433c:	c7 44 24 04 0a 01 00 	movl   $0x10a,0x4(%esp)
  104343:	00 
  104344:	c7 04 24 c4 6b 10 00 	movl   $0x106bc4,(%esp)
  10434b:	e8 76 c9 ff ff       	call   100cc6 <__panic>
        *ptep = pa | PTE_P | perm;
  104350:	8b 45 18             	mov    0x18(%ebp),%eax
  104353:	8b 55 14             	mov    0x14(%ebp),%edx
  104356:	09 d0                	or     %edx,%eax
  104358:	83 c8 01             	or     $0x1,%eax
  10435b:	89 c2                	mov    %eax,%edx
  10435d:	8b 45 e0             	mov    -0x20(%ebp),%eax
  104360:	89 10                	mov    %edx,(%eax)
boot_map_segment(pde_t *pgdir, uintptr_t la, size_t size, uintptr_t pa, uint32_t perm) {
    assert(PGOFF(la) == PGOFF(pa));
    size_t n = ROUNDUP(size + PGOFF(la), PGSIZE) / PGSIZE;
    la = ROUNDDOWN(la, PGSIZE);
    pa = ROUNDDOWN(pa, PGSIZE);
    for (; n > 0; n --, la += PGSIZE, pa += PGSIZE) {
  104362:	83 6d f4 01          	subl   $0x1,-0xc(%ebp)
  104366:	81 45 0c 00 10 00 00 	addl   $0x1000,0xc(%ebp)
  10436d:	81 45 14 00 10 00 00 	addl   $0x1000,0x14(%ebp)
  104374:	83 7d f4 00          	cmpl   $0x0,-0xc(%ebp)
  104378:	75 8f                	jne    104309 <boot_map_segment+0x9a>
        pte_t *ptep = get_pte(pgdir, la, 1);
        assert(ptep != NULL);
        *ptep = pa | PTE_P | perm;
    }
}
  10437a:	c9                   	leave  
  10437b:	c3                   	ret    

0010437c <boot_alloc_page>:

//boot_alloc_page - allocate one page using pmm->alloc_pages(1) 
// return value: the kernel virtual address of this allocated page
//note: this function is used to get the memory for PDT(Page Directory Table)&PT(Page Table)
static void *
boot_alloc_page(void) {
  10437c:	55                   	push   %ebp
  10437d:	89 e5                	mov    %esp,%ebp
  10437f:	83 ec 28             	sub    $0x28,%esp
    struct Page *p = alloc_page();
  104382:	c7 04 24 01 00 00 00 	movl   $0x1,(%esp)
  104389:	e8 22 fa ff ff       	call   103db0 <alloc_pages>
  10438e:	89 45 f4             	mov    %eax,-0xc(%ebp)
    if (p == NULL) {
  104391:	83 7d f4 00          	cmpl   $0x0,-0xc(%ebp)
  104395:	75 1c                	jne    1043b3 <boot_alloc_page+0x37>
        panic("boot_alloc_page failed.\n");
  104397:	c7 44 24 08 0b 6c 10 	movl   $0x106c0b,0x8(%esp)
  10439e:	00 
  10439f:	c7 44 24 04 16 01 00 	movl   $0x116,0x4(%esp)
  1043a6:	00 
  1043a7:	c7 04 24 c4 6b 10 00 	movl   $0x106bc4,(%esp)
  1043ae:	e8 13 c9 ff ff       	call   100cc6 <__panic>
    }
    return page2kva(p);
  1043b3:	8b 45 f4             	mov    -0xc(%ebp),%eax
  1043b6:	89 04 24             	mov    %eax,(%esp)
  1043b9:	e8 5b f7 ff ff       	call   103b19 <page2kva>
}
  1043be:	c9                   	leave  
  1043bf:	c3                   	ret    

001043c0 <pmm_init>:

//pmm_init - setup a pmm to manage physical memory, build PDT&PT to setup paging mechanism 
//         - check the correctness of pmm & paging mechanism, print PDT&PT
void
pmm_init(void) {
  1043c0:	55                   	push   %ebp
  1043c1:	89 e5                	mov    %esp,%ebp
  1043c3:	83 ec 38             	sub    $0x38,%esp
    //We need to alloc/free the physical memory (granularity is 4KB or other size). 
    //So a framework of physical memory manager (struct pmm_manager)is defined in pmm.h
    //First we should init a physical memory manager(pmm) based on the framework.
    //Then pmm can alloc/free the physical memory. 
    //Now the first_fit/best_fit/worst_fit/buddy_system pmm are available.
    init_pmm_manager();
  1043c6:	e8 93 f9 ff ff       	call   103d5e <init_pmm_manager>

    // detect physical memory space, reserve already used memory,
    // then use pmm->init_memmap to create free page list
    page_init();
  1043cb:	e8 75 fa ff ff       	call   103e45 <page_init>

    //use pmm->check to verify the correctness of the alloc/free function in a pmm
    check_alloc_page();
  1043d0:	e8 6b 04 00 00       	call   104840 <check_alloc_page>

    // create boot_pgdir, an initial page directory(Page Directory Table, PDT)
    boot_pgdir = boot_alloc_page();
  1043d5:	e8 a2 ff ff ff       	call   10437c <boot_alloc_page>
  1043da:	a3 c4 88 11 00       	mov    %eax,0x1188c4
    memset(boot_pgdir, 0, PGSIZE);
  1043df:	a1 c4 88 11 00       	mov    0x1188c4,%eax
  1043e4:	c7 44 24 08 00 10 00 	movl   $0x1000,0x8(%esp)
  1043eb:	00 
  1043ec:	c7 44 24 04 00 00 00 	movl   $0x0,0x4(%esp)
  1043f3:	00 
  1043f4:	89 04 24             	mov    %eax,(%esp)
  1043f7:	e8 ad 1a 00 00       	call   105ea9 <memset>
    boot_cr3 = PADDR(boot_pgdir);
  1043fc:	a1 c4 88 11 00       	mov    0x1188c4,%eax
  104401:	89 45 f4             	mov    %eax,-0xc(%ebp)
  104404:	81 7d f4 ff ff ff bf 	cmpl   $0xbfffffff,-0xc(%ebp)
  10440b:	77 23                	ja     104430 <pmm_init+0x70>
  10440d:	8b 45 f4             	mov    -0xc(%ebp),%eax
  104410:	89 44 24 0c          	mov    %eax,0xc(%esp)
  104414:	c7 44 24 08 a0 6b 10 	movl   $0x106ba0,0x8(%esp)
  10441b:	00 
  10441c:	c7 44 24 04 30 01 00 	movl   $0x130,0x4(%esp)
  104423:	00 
  104424:	c7 04 24 c4 6b 10 00 	movl   $0x106bc4,(%esp)
  10442b:	e8 96 c8 ff ff       	call   100cc6 <__panic>
  104430:	8b 45 f4             	mov    -0xc(%ebp),%eax
  104433:	05 00 00 00 40       	add    $0x40000000,%eax
  104438:	a3 c0 89 11 00       	mov    %eax,0x1189c0

    check_pgdir();
  10443d:	e8 1c 04 00 00       	call   10485e <check_pgdir>

    static_assert(KERNBASE % PTSIZE == 0 && KERNTOP % PTSIZE == 0);

    // recursively insert boot_pgdir in itself
    // to form a virtual page table at virtual address VPT
    boot_pgdir[PDX(VPT)] = PADDR(boot_pgdir) | PTE_P | PTE_W;
  104442:	a1 c4 88 11 00       	mov    0x1188c4,%eax
  104447:	8d 90 ac 0f 00 00    	lea    0xfac(%eax),%edx
  10444d:	a1 c4 88 11 00       	mov    0x1188c4,%eax
  104452:	89 45 f0             	mov    %eax,-0x10(%ebp)
  104455:	81 7d f0 ff ff ff bf 	cmpl   $0xbfffffff,-0x10(%ebp)
  10445c:	77 23                	ja     104481 <pmm_init+0xc1>
  10445e:	8b 45 f0             	mov    -0x10(%ebp),%eax
  104461:	89 44 24 0c          	mov    %eax,0xc(%esp)
  104465:	c7 44 24 08 a0 6b 10 	movl   $0x106ba0,0x8(%esp)
  10446c:	00 
  10446d:	c7 44 24 04 38 01 00 	movl   $0x138,0x4(%esp)
  104474:	00 
  104475:	c7 04 24 c4 6b 10 00 	movl   $0x106bc4,(%esp)
  10447c:	e8 45 c8 ff ff       	call   100cc6 <__panic>
  104481:	8b 45 f0             	mov    -0x10(%ebp),%eax
  104484:	05 00 00 00 40       	add    $0x40000000,%eax
  104489:	83 c8 03             	or     $0x3,%eax
  10448c:	89 02                	mov    %eax,(%edx)

    // map all physical memory to linear memory with base linear addr KERNBASE
    //linear_addr KERNBASE~KERNBASE+KMEMSIZE = phy_addr 0~KMEMSIZE
    //But shouldn't use this map until enable_paging() & gdt_init() finished.
    boot_map_segment(boot_pgdir, KERNBASE, KMEMSIZE, 0, PTE_W);
  10448e:	a1 c4 88 11 00       	mov    0x1188c4,%eax
  104493:	c7 44 24 10 02 00 00 	movl   $0x2,0x10(%esp)
  10449a:	00 
  10449b:	c7 44 24 0c 00 00 00 	movl   $0x0,0xc(%esp)
  1044a2:	00 
  1044a3:	c7 44 24 08 00 00 00 	movl   $0x38000000,0x8(%esp)
  1044aa:	38 
  1044ab:	c7 44 24 04 00 00 00 	movl   $0xc0000000,0x4(%esp)
  1044b2:	c0 
  1044b3:	89 04 24             	mov    %eax,(%esp)
  1044b6:	e8 b4 fd ff ff       	call   10426f <boot_map_segment>

    //temporary map: 
    //virtual_addr 3G~3G+4M = linear_addr 0~4M = linear_addr 3G~3G+4M = phy_addr 0~4M     
    boot_pgdir[0] = boot_pgdir[PDX(KERNBASE)];
  1044bb:	a1 c4 88 11 00       	mov    0x1188c4,%eax
  1044c0:	8b 15 c4 88 11 00    	mov    0x1188c4,%edx
  1044c6:	8b 92 00 0c 00 00    	mov    0xc00(%edx),%edx
  1044cc:	89 10                	mov    %edx,(%eax)

    enable_paging();
  1044ce:	e8 63 fd ff ff       	call   104236 <enable_paging>

    //reload gdt(third time,the last time) to map all physical memory
    //virtual_addr 0~4G=liear_addr 0~4G
    //then set kernel stack(ss:esp) in TSS, setup TSS in gdt, load TSS
    gdt_init();
  1044d3:	e8 97 f7 ff ff       	call   103c6f <gdt_init>

    //disable the map of virtual_addr 0~4M
    boot_pgdir[0] = 0;
  1044d8:	a1 c4 88 11 00       	mov    0x1188c4,%eax
  1044dd:	c7 00 00 00 00 00    	movl   $0x0,(%eax)

    //now the basic virtual memory map(see memalyout.h) is established.
    //check the correctness of the basic virtual memory map.
    check_boot_pgdir();
  1044e3:	e8 11 0a 00 00       	call   104ef9 <check_boot_pgdir>

    print_pgdir();
  1044e8:	e8 9e 0e 00 00       	call   10538b <print_pgdir>

}
  1044ed:	c9                   	leave  
  1044ee:	c3                   	ret    

001044ef <get_pte>:
//  pgdir:  the kernel virtual base address of PDT
//  la:     the linear address need to map
//  create: a logical value to decide if alloc a page for PT
// return vaule: the kernel virtual address of this pte
pte_t *
get_pte(pde_t *pgdir, uintptr_t la, bool create) {
  1044ef:	55                   	push   %ebp
  1044f0:	89 e5                	mov    %esp,%ebp
  1044f2:	83 ec 38             	sub    $0x38,%esp
    }
    return NULL;          // (8) return page table entry
#endif


	pde_t *pdep = &pgdir[PDX(la)];  //find page directory entry
  1044f5:	8b 45 0c             	mov    0xc(%ebp),%eax
  1044f8:	c1 e8 16             	shr    $0x16,%eax
  1044fb:	8d 14 85 00 00 00 00 	lea    0x0(,%eax,4),%edx
  104502:	8b 45 08             	mov    0x8(%ebp),%eax
  104505:	01 d0                	add    %edx,%eax
  104507:	89 45 f4             	mov    %eax,-0xc(%ebp)
        if (!(*pdep & PTE_P)) { //check whether  present or not; pdep points at its control information 
  10450a:	8b 45 f4             	mov    -0xc(%ebp),%eax
  10450d:	8b 00                	mov    (%eax),%eax
  10450f:	83 e0 01             	and    $0x1,%eax
  104512:	85 c0                	test   %eax,%eax
  104514:	0f 85 af 00 00 00    	jne    1045c9 <get_pte+0xda>
            struct Page *page;

            if (!create || (page = alloc_page()) == NULL) {  //check create is needed also check if we can alloc a page in the table
  10451a:	83 7d 10 00          	cmpl   $0x0,0x10(%ebp)
  10451e:	74 15                	je     104535 <get_pte+0x46>
  104520:	c7 04 24 01 00 00 00 	movl   $0x1,(%esp)
  104527:	e8 84 f8 ff ff       	call   103db0 <alloc_pages>
  10452c:	89 45 f0             	mov    %eax,-0x10(%ebp)
  10452f:	83 7d f0 00          	cmpl   $0x0,-0x10(%ebp)
  104533:	75 0a                	jne    10453f <get_pte+0x50>
                return NULL;
  104535:	b8 00 00 00 00       	mov    $0x0,%eax
  10453a:	e9 e6 00 00 00       	jmp    104625 <get_pte+0x136>
        }
        set_page_ref(page, 1); //a new page's reference should be 1
  10453f:	c7 44 24 04 01 00 00 	movl   $0x1,0x4(%esp)
  104546:	00 
  104547:	8b 45 f0             	mov    -0x10(%ebp),%eax
  10454a:	89 04 24             	mov    %eax,(%esp)
  10454d:	e8 63 f6 ff ff       	call   103bb5 <set_page_ref>
        uintptr_t pa = page2pa(page);  //linear address
  104552:	8b 45 f0             	mov    -0x10(%ebp),%eax
  104555:	89 04 24             	mov    %eax,(%esp)
  104558:	e8 57 f5 ff ff       	call   103ab4 <page2pa>
  10455d:	89 45 ec             	mov    %eax,-0x14(%ebp)
        memset(KADDR(pa), 0, PGSIZE); //initialize the page; the arg la should be converted into the real v address with macro KADDR
  104560:	8b 45 ec             	mov    -0x14(%ebp),%eax
  104563:	89 45 e8             	mov    %eax,-0x18(%ebp)
  104566:	8b 45 e8             	mov    -0x18(%ebp),%eax
  104569:	c1 e8 0c             	shr    $0xc,%eax
  10456c:	89 45 e4             	mov    %eax,-0x1c(%ebp)
  10456f:	a1 c0 88 11 00       	mov    0x1188c0,%eax
  104574:	39 45 e4             	cmp    %eax,-0x1c(%ebp)
  104577:	72 23                	jb     10459c <get_pte+0xad>
  104579:	8b 45 e8             	mov    -0x18(%ebp),%eax
  10457c:	89 44 24 0c          	mov    %eax,0xc(%esp)
  104580:	c7 44 24 08 fc 6a 10 	movl   $0x106afc,0x8(%esp)
  104587:	00 
  104588:	c7 44 24 04 8a 01 00 	movl   $0x18a,0x4(%esp)
  10458f:	00 
  104590:	c7 04 24 c4 6b 10 00 	movl   $0x106bc4,(%esp)
  104597:	e8 2a c7 ff ff       	call   100cc6 <__panic>
  10459c:	8b 45 e8             	mov    -0x18(%ebp),%eax
  10459f:	2d 00 00 00 40       	sub    $0x40000000,%eax
  1045a4:	c7 44 24 08 00 10 00 	movl   $0x1000,0x8(%esp)
  1045ab:	00 
  1045ac:	c7 44 24 04 00 00 00 	movl   $0x0,0x4(%esp)
  1045b3:	00 
  1045b4:	89 04 24             	mov    %eax,(%esp)
  1045b7:	e8 ed 18 00 00       	call   105ea9 <memset>
        *pdep = pa | PTE_U | PTE_W | PTE_P; //设置控制位
  1045bc:	8b 45 ec             	mov    -0x14(%ebp),%eax
  1045bf:	83 c8 07             	or     $0x7,%eax
  1045c2:	89 c2                	mov    %eax,%edx
  1045c4:	8b 45 f4             	mov    -0xc(%ebp),%eax
  1045c7:	89 10                	mov    %edx,(%eax)
    }
    return &((pte_t *)KADDR(PDE_ADDR(*pdep)))[PTX(la)]; 
  1045c9:	8b 45 f4             	mov    -0xc(%ebp),%eax
  1045cc:	8b 00                	mov    (%eax),%eax
  1045ce:	25 00 f0 ff ff       	and    $0xfffff000,%eax
  1045d3:	89 45 e0             	mov    %eax,-0x20(%ebp)
  1045d6:	8b 45 e0             	mov    -0x20(%ebp),%eax
  1045d9:	c1 e8 0c             	shr    $0xc,%eax
  1045dc:	89 45 dc             	mov    %eax,-0x24(%ebp)
  1045df:	a1 c0 88 11 00       	mov    0x1188c0,%eax
  1045e4:	39 45 dc             	cmp    %eax,-0x24(%ebp)
  1045e7:	72 23                	jb     10460c <get_pte+0x11d>
  1045e9:	8b 45 e0             	mov    -0x20(%ebp),%eax
  1045ec:	89 44 24 0c          	mov    %eax,0xc(%esp)
  1045f0:	c7 44 24 08 fc 6a 10 	movl   $0x106afc,0x8(%esp)
  1045f7:	00 
  1045f8:	c7 44 24 04 8d 01 00 	movl   $0x18d,0x4(%esp)
  1045ff:	00 
  104600:	c7 04 24 c4 6b 10 00 	movl   $0x106bc4,(%esp)
  104607:	e8 ba c6 ff ff       	call   100cc6 <__panic>
  10460c:	8b 45 e0             	mov    -0x20(%ebp),%eax
  10460f:	2d 00 00 00 40       	sub    $0x40000000,%eax
  104614:	8b 55 0c             	mov    0xc(%ebp),%edx
  104617:	c1 ea 0c             	shr    $0xc,%edx
  10461a:	81 e2 ff 03 00 00    	and    $0x3ff,%edx
  104620:	c1 e2 02             	shl    $0x2,%edx
  104623:	01 d0                	add    %edx,%eax
    



}
  104625:	c9                   	leave  
  104626:	c3                   	ret    

00104627 <get_page>:

//get_page - get related Page struct for linear address la using PDT pgdir
struct Page *
get_page(pde_t *pgdir, uintptr_t la, pte_t **ptep_store) {
  104627:	55                   	push   %ebp
  104628:	89 e5                	mov    %esp,%ebp
  10462a:	83 ec 28             	sub    $0x28,%esp
    pte_t *ptep = get_pte(pgdir, la, 0);
  10462d:	c7 44 24 08 00 00 00 	movl   $0x0,0x8(%esp)
  104634:	00 
  104635:	8b 45 0c             	mov    0xc(%ebp),%eax
  104638:	89 44 24 04          	mov    %eax,0x4(%esp)
  10463c:	8b 45 08             	mov    0x8(%ebp),%eax
  10463f:	89 04 24             	mov    %eax,(%esp)
  104642:	e8 a8 fe ff ff       	call   1044ef <get_pte>
  104647:	89 45 f4             	mov    %eax,-0xc(%ebp)
    if (ptep_store != NULL) {
  10464a:	83 7d 10 00          	cmpl   $0x0,0x10(%ebp)
  10464e:	74 08                	je     104658 <get_page+0x31>
        *ptep_store = ptep;
  104650:	8b 45 10             	mov    0x10(%ebp),%eax
  104653:	8b 55 f4             	mov    -0xc(%ebp),%edx
  104656:	89 10                	mov    %edx,(%eax)
    }
    if (ptep != NULL && *ptep & PTE_P) {
  104658:	83 7d f4 00          	cmpl   $0x0,-0xc(%ebp)
  10465c:	74 1b                	je     104679 <get_page+0x52>
  10465e:	8b 45 f4             	mov    -0xc(%ebp),%eax
  104661:	8b 00                	mov    (%eax),%eax
  104663:	83 e0 01             	and    $0x1,%eax
  104666:	85 c0                	test   %eax,%eax
  104668:	74 0f                	je     104679 <get_page+0x52>
        return pa2page(*ptep);
  10466a:	8b 45 f4             	mov    -0xc(%ebp),%eax
  10466d:	8b 00                	mov    (%eax),%eax
  10466f:	89 04 24             	mov    %eax,(%esp)
  104672:	e8 53 f4 ff ff       	call   103aca <pa2page>
  104677:	eb 05                	jmp    10467e <get_page+0x57>
    }
    return NULL;
  104679:	b8 00 00 00 00       	mov    $0x0,%eax
}
  10467e:	c9                   	leave  
  10467f:	c3                   	ret    

00104680 <page_remove_pte>:

//page_remove_pte - free an Page sturct which is related linear address la
//                - and clean(invalidate) pte which is related linear address la
//note: PT is changed, so the TLB need to be invalidate 
static inline void
page_remove_pte(pde_t *pgdir, uintptr_t la, pte_t *ptep) {
  104680:	55                   	push   %ebp
  104681:	89 e5                	mov    %esp,%ebp
  104683:	83 ec 28             	sub    $0x28,%esp
                                  //(4) and free this page when page reference reachs 0
                                  //(5) clear second page table entry
                                  //(6) flush tlb
    }
#endif
	if (*ptep & PTE_P){
  104686:	8b 45 10             	mov    0x10(%ebp),%eax
  104689:	8b 00                	mov    (%eax),%eax
  10468b:	83 e0 01             	and    $0x1,%eax
  10468e:	85 c0                	test   %eax,%eax
  104690:	74 52                	je     1046e4 <page_remove_pte+0x64>
		struct Page* page = pte2page(*ptep);
  104692:	8b 45 10             	mov    0x10(%ebp),%eax
  104695:	8b 00                	mov    (%eax),%eax
  104697:	89 04 24             	mov    %eax,(%esp)
  10469a:	e8 ce f4 ff ff       	call   103b6d <pte2page>
  10469f:	89 45 f4             	mov    %eax,-0xc(%ebp)
		page_ref_dec(page);
  1046a2:	8b 45 f4             	mov    -0xc(%ebp),%eax
  1046a5:	89 04 24             	mov    %eax,(%esp)
  1046a8:	e8 2c f5 ff ff       	call   103bd9 <page_ref_dec>
		if (page->ref == 0) free_page(page);
  1046ad:	8b 45 f4             	mov    -0xc(%ebp),%eax
  1046b0:	8b 00                	mov    (%eax),%eax
  1046b2:	85 c0                	test   %eax,%eax
  1046b4:	75 13                	jne    1046c9 <page_remove_pte+0x49>
  1046b6:	c7 44 24 04 01 00 00 	movl   $0x1,0x4(%esp)
  1046bd:	00 
  1046be:	8b 45 f4             	mov    -0xc(%ebp),%eax
  1046c1:	89 04 24             	mov    %eax,(%esp)
  1046c4:	e8 1f f7 ff ff       	call   103de8 <free_pages>
		 *ptep = 0;                              //(5) clear second page table entry
  1046c9:	8b 45 10             	mov    0x10(%ebp),%eax
  1046cc:	c7 00 00 00 00 00    	movl   $0x0,(%eax)
        	tlb_invalidate(pgdir, la); 
  1046d2:	8b 45 0c             	mov    0xc(%ebp),%eax
  1046d5:	89 44 24 04          	mov    %eax,0x4(%esp)
  1046d9:	8b 45 08             	mov    0x8(%ebp),%eax
  1046dc:	89 04 24             	mov    %eax,(%esp)
  1046df:	e8 ff 00 00 00       	call   1047e3 <tlb_invalidate>
	}

}
  1046e4:	c9                   	leave  
  1046e5:	c3                   	ret    

001046e6 <page_remove>:

//page_remove - free an Page which is related linear address la and has an validated pte
void
page_remove(pde_t *pgdir, uintptr_t la) {
  1046e6:	55                   	push   %ebp
  1046e7:	89 e5                	mov    %esp,%ebp
  1046e9:	83 ec 28             	sub    $0x28,%esp
    pte_t *ptep = get_pte(pgdir, la, 0);
  1046ec:	c7 44 24 08 00 00 00 	movl   $0x0,0x8(%esp)
  1046f3:	00 
  1046f4:	8b 45 0c             	mov    0xc(%ebp),%eax
  1046f7:	89 44 24 04          	mov    %eax,0x4(%esp)
  1046fb:	8b 45 08             	mov    0x8(%ebp),%eax
  1046fe:	89 04 24             	mov    %eax,(%esp)
  104701:	e8 e9 fd ff ff       	call   1044ef <get_pte>
  104706:	89 45 f4             	mov    %eax,-0xc(%ebp)
    if (ptep != NULL) {
  104709:	83 7d f4 00          	cmpl   $0x0,-0xc(%ebp)
  10470d:	74 19                	je     104728 <page_remove+0x42>
        page_remove_pte(pgdir, la, ptep);
  10470f:	8b 45 f4             	mov    -0xc(%ebp),%eax
  104712:	89 44 24 08          	mov    %eax,0x8(%esp)
  104716:	8b 45 0c             	mov    0xc(%ebp),%eax
  104719:	89 44 24 04          	mov    %eax,0x4(%esp)
  10471d:	8b 45 08             	mov    0x8(%ebp),%eax
  104720:	89 04 24             	mov    %eax,(%esp)
  104723:	e8 58 ff ff ff       	call   104680 <page_remove_pte>
    }
}
  104728:	c9                   	leave  
  104729:	c3                   	ret    

0010472a <page_insert>:
//  la:    the linear address need to map
//  perm:  the permission of this Page which is setted in related pte
// return value: always 0
//note: PT is changed, so the TLB need to be invalidate 
int
page_insert(pde_t *pgdir, struct Page *page, uintptr_t la, uint32_t perm) {
  10472a:	55                   	push   %ebp
  10472b:	89 e5                	mov    %esp,%ebp
  10472d:	83 ec 28             	sub    $0x28,%esp
    pte_t *ptep = get_pte(pgdir, la, 1);
  104730:	c7 44 24 08 01 00 00 	movl   $0x1,0x8(%esp)
  104737:	00 
  104738:	8b 45 10             	mov    0x10(%ebp),%eax
  10473b:	89 44 24 04          	mov    %eax,0x4(%esp)
  10473f:	8b 45 08             	mov    0x8(%ebp),%eax
  104742:	89 04 24             	mov    %eax,(%esp)
  104745:	e8 a5 fd ff ff       	call   1044ef <get_pte>
  10474a:	89 45 f4             	mov    %eax,-0xc(%ebp)
    if (ptep == NULL) {
  10474d:	83 7d f4 00          	cmpl   $0x0,-0xc(%ebp)
  104751:	75 0a                	jne    10475d <page_insert+0x33>
        return -E_NO_MEM;
  104753:	b8 fc ff ff ff       	mov    $0xfffffffc,%eax
  104758:	e9 84 00 00 00       	jmp    1047e1 <page_insert+0xb7>
    }
    page_ref_inc(page);
  10475d:	8b 45 0c             	mov    0xc(%ebp),%eax
  104760:	89 04 24             	mov    %eax,(%esp)
  104763:	e8 5a f4 ff ff       	call   103bc2 <page_ref_inc>
    if (*ptep & PTE_P) {
  104768:	8b 45 f4             	mov    -0xc(%ebp),%eax
  10476b:	8b 00                	mov    (%eax),%eax
  10476d:	83 e0 01             	and    $0x1,%eax
  104770:	85 c0                	test   %eax,%eax
  104772:	74 3e                	je     1047b2 <page_insert+0x88>
        struct Page *p = pte2page(*ptep);
  104774:	8b 45 f4             	mov    -0xc(%ebp),%eax
  104777:	8b 00                	mov    (%eax),%eax
  104779:	89 04 24             	mov    %eax,(%esp)
  10477c:	e8 ec f3 ff ff       	call   103b6d <pte2page>
  104781:	89 45 f0             	mov    %eax,-0x10(%ebp)
        if (p == page) {
  104784:	8b 45 f0             	mov    -0x10(%ebp),%eax
  104787:	3b 45 0c             	cmp    0xc(%ebp),%eax
  10478a:	75 0d                	jne    104799 <page_insert+0x6f>
            page_ref_dec(page);
  10478c:	8b 45 0c             	mov    0xc(%ebp),%eax
  10478f:	89 04 24             	mov    %eax,(%esp)
  104792:	e8 42 f4 ff ff       	call   103bd9 <page_ref_dec>
  104797:	eb 19                	jmp    1047b2 <page_insert+0x88>
        }
        else {
            page_remove_pte(pgdir, la, ptep);
  104799:	8b 45 f4             	mov    -0xc(%ebp),%eax
  10479c:	89 44 24 08          	mov    %eax,0x8(%esp)
  1047a0:	8b 45 10             	mov    0x10(%ebp),%eax
  1047a3:	89 44 24 04          	mov    %eax,0x4(%esp)
  1047a7:	8b 45 08             	mov    0x8(%ebp),%eax
  1047aa:	89 04 24             	mov    %eax,(%esp)
  1047ad:	e8 ce fe ff ff       	call   104680 <page_remove_pte>
        }
    }
    *ptep = page2pa(page) | PTE_P | perm;
  1047b2:	8b 45 0c             	mov    0xc(%ebp),%eax
  1047b5:	89 04 24             	mov    %eax,(%esp)
  1047b8:	e8 f7 f2 ff ff       	call   103ab4 <page2pa>
  1047bd:	0b 45 14             	or     0x14(%ebp),%eax
  1047c0:	83 c8 01             	or     $0x1,%eax
  1047c3:	89 c2                	mov    %eax,%edx
  1047c5:	8b 45 f4             	mov    -0xc(%ebp),%eax
  1047c8:	89 10                	mov    %edx,(%eax)
    tlb_invalidate(pgdir, la);
  1047ca:	8b 45 10             	mov    0x10(%ebp),%eax
  1047cd:	89 44 24 04          	mov    %eax,0x4(%esp)
  1047d1:	8b 45 08             	mov    0x8(%ebp),%eax
  1047d4:	89 04 24             	mov    %eax,(%esp)
  1047d7:	e8 07 00 00 00       	call   1047e3 <tlb_invalidate>
    return 0;
  1047dc:	b8 00 00 00 00       	mov    $0x0,%eax
}
  1047e1:	c9                   	leave  
  1047e2:	c3                   	ret    

001047e3 <tlb_invalidate>:

// invalidate a TLB entry, but only if the page tables being
// edited are the ones currently in use by the processor.
void
tlb_invalidate(pde_t *pgdir, uintptr_t la) {
  1047e3:	55                   	push   %ebp
  1047e4:	89 e5                	mov    %esp,%ebp
  1047e6:	83 ec 28             	sub    $0x28,%esp
}

static inline uintptr_t
rcr3(void) {
    uintptr_t cr3;
    asm volatile ("mov %%cr3, %0" : "=r" (cr3) :: "memory");
  1047e9:	0f 20 d8             	mov    %cr3,%eax
  1047ec:	89 45 f0             	mov    %eax,-0x10(%ebp)
    return cr3;
  1047ef:	8b 45 f0             	mov    -0x10(%ebp),%eax
    if (rcr3() == PADDR(pgdir)) {
  1047f2:	89 c2                	mov    %eax,%edx
  1047f4:	8b 45 08             	mov    0x8(%ebp),%eax
  1047f7:	89 45 f4             	mov    %eax,-0xc(%ebp)
  1047fa:	81 7d f4 ff ff ff bf 	cmpl   $0xbfffffff,-0xc(%ebp)
  104801:	77 23                	ja     104826 <tlb_invalidate+0x43>
  104803:	8b 45 f4             	mov    -0xc(%ebp),%eax
  104806:	89 44 24 0c          	mov    %eax,0xc(%esp)
  10480a:	c7 44 24 08 a0 6b 10 	movl   $0x106ba0,0x8(%esp)
  104811:	00 
  104812:	c7 44 24 04 f3 01 00 	movl   $0x1f3,0x4(%esp)
  104819:	00 
  10481a:	c7 04 24 c4 6b 10 00 	movl   $0x106bc4,(%esp)
  104821:	e8 a0 c4 ff ff       	call   100cc6 <__panic>
  104826:	8b 45 f4             	mov    -0xc(%ebp),%eax
  104829:	05 00 00 00 40       	add    $0x40000000,%eax
  10482e:	39 c2                	cmp    %eax,%edx
  104830:	75 0c                	jne    10483e <tlb_invalidate+0x5b>
        invlpg((void *)la);
  104832:	8b 45 0c             	mov    0xc(%ebp),%eax
  104835:	89 45 ec             	mov    %eax,-0x14(%ebp)
}

static inline void
invlpg(void *addr) {
    asm volatile ("invlpg (%0)" :: "r" (addr) : "memory");
  104838:	8b 45 ec             	mov    -0x14(%ebp),%eax
  10483b:	0f 01 38             	invlpg (%eax)
    }
}
  10483e:	c9                   	leave  
  10483f:	c3                   	ret    

00104840 <check_alloc_page>:

static void
check_alloc_page(void) {
  104840:	55                   	push   %ebp
  104841:	89 e5                	mov    %esp,%ebp
  104843:	83 ec 18             	sub    $0x18,%esp
    pmm_manager->check();
  104846:	a1 bc 89 11 00       	mov    0x1189bc,%eax
  10484b:	8b 40 18             	mov    0x18(%eax),%eax
  10484e:	ff d0                	call   *%eax
    cprintf("check_alloc_page() succeeded!\n");
  104850:	c7 04 24 24 6c 10 00 	movl   $0x106c24,(%esp)
  104857:	e8 e0 ba ff ff       	call   10033c <cprintf>
}
  10485c:	c9                   	leave  
  10485d:	c3                   	ret    

0010485e <check_pgdir>:

static void
check_pgdir(void) {
  10485e:	55                   	push   %ebp
  10485f:	89 e5                	mov    %esp,%ebp
  104861:	83 ec 38             	sub    $0x38,%esp
    assert(npage <= KMEMSIZE / PGSIZE);
  104864:	a1 c0 88 11 00       	mov    0x1188c0,%eax
  104869:	3d 00 80 03 00       	cmp    $0x38000,%eax
  10486e:	76 24                	jbe    104894 <check_pgdir+0x36>
  104870:	c7 44 24 0c 43 6c 10 	movl   $0x106c43,0xc(%esp)
  104877:	00 
  104878:	c7 44 24 08 e9 6b 10 	movl   $0x106be9,0x8(%esp)
  10487f:	00 
  104880:	c7 44 24 04 00 02 00 	movl   $0x200,0x4(%esp)
  104887:	00 
  104888:	c7 04 24 c4 6b 10 00 	movl   $0x106bc4,(%esp)
  10488f:	e8 32 c4 ff ff       	call   100cc6 <__panic>
    assert(boot_pgdir != NULL && (uint32_t)PGOFF(boot_pgdir) == 0);
  104894:	a1 c4 88 11 00       	mov    0x1188c4,%eax
  104899:	85 c0                	test   %eax,%eax
  10489b:	74 0e                	je     1048ab <check_pgdir+0x4d>
  10489d:	a1 c4 88 11 00       	mov    0x1188c4,%eax
  1048a2:	25 ff 0f 00 00       	and    $0xfff,%eax
  1048a7:	85 c0                	test   %eax,%eax
  1048a9:	74 24                	je     1048cf <check_pgdir+0x71>
  1048ab:	c7 44 24 0c 60 6c 10 	movl   $0x106c60,0xc(%esp)
  1048b2:	00 
  1048b3:	c7 44 24 08 e9 6b 10 	movl   $0x106be9,0x8(%esp)
  1048ba:	00 
  1048bb:	c7 44 24 04 01 02 00 	movl   $0x201,0x4(%esp)
  1048c2:	00 
  1048c3:	c7 04 24 c4 6b 10 00 	movl   $0x106bc4,(%esp)
  1048ca:	e8 f7 c3 ff ff       	call   100cc6 <__panic>
    assert(get_page(boot_pgdir, 0x0, NULL) == NULL);
  1048cf:	a1 c4 88 11 00       	mov    0x1188c4,%eax
  1048d4:	c7 44 24 08 00 00 00 	movl   $0x0,0x8(%esp)
  1048db:	00 
  1048dc:	c7 44 24 04 00 00 00 	movl   $0x0,0x4(%esp)
  1048e3:	00 
  1048e4:	89 04 24             	mov    %eax,(%esp)
  1048e7:	e8 3b fd ff ff       	call   104627 <get_page>
  1048ec:	85 c0                	test   %eax,%eax
  1048ee:	74 24                	je     104914 <check_pgdir+0xb6>
  1048f0:	c7 44 24 0c 98 6c 10 	movl   $0x106c98,0xc(%esp)
  1048f7:	00 
  1048f8:	c7 44 24 08 e9 6b 10 	movl   $0x106be9,0x8(%esp)
  1048ff:	00 
  104900:	c7 44 24 04 02 02 00 	movl   $0x202,0x4(%esp)
  104907:	00 
  104908:	c7 04 24 c4 6b 10 00 	movl   $0x106bc4,(%esp)
  10490f:	e8 b2 c3 ff ff       	call   100cc6 <__panic>

    struct Page *p1, *p2;
    p1 = alloc_page();
  104914:	c7 04 24 01 00 00 00 	movl   $0x1,(%esp)
  10491b:	e8 90 f4 ff ff       	call   103db0 <alloc_pages>
  104920:	89 45 f4             	mov    %eax,-0xc(%ebp)
    assert(page_insert(boot_pgdir, p1, 0x0, 0) == 0);
  104923:	a1 c4 88 11 00       	mov    0x1188c4,%eax
  104928:	c7 44 24 0c 00 00 00 	movl   $0x0,0xc(%esp)
  10492f:	00 
  104930:	c7 44 24 08 00 00 00 	movl   $0x0,0x8(%esp)
  104937:	00 
  104938:	8b 55 f4             	mov    -0xc(%ebp),%edx
  10493b:	89 54 24 04          	mov    %edx,0x4(%esp)
  10493f:	89 04 24             	mov    %eax,(%esp)
  104942:	e8 e3 fd ff ff       	call   10472a <page_insert>
  104947:	85 c0                	test   %eax,%eax
  104949:	74 24                	je     10496f <check_pgdir+0x111>
  10494b:	c7 44 24 0c c0 6c 10 	movl   $0x106cc0,0xc(%esp)
  104952:	00 
  104953:	c7 44 24 08 e9 6b 10 	movl   $0x106be9,0x8(%esp)
  10495a:	00 
  10495b:	c7 44 24 04 06 02 00 	movl   $0x206,0x4(%esp)
  104962:	00 
  104963:	c7 04 24 c4 6b 10 00 	movl   $0x106bc4,(%esp)
  10496a:	e8 57 c3 ff ff       	call   100cc6 <__panic>

    pte_t *ptep;
    assert((ptep = get_pte(boot_pgdir, 0x0, 0)) != NULL);
  10496f:	a1 c4 88 11 00       	mov    0x1188c4,%eax
  104974:	c7 44 24 08 00 00 00 	movl   $0x0,0x8(%esp)
  10497b:	00 
  10497c:	c7 44 24 04 00 00 00 	movl   $0x0,0x4(%esp)
  104983:	00 
  104984:	89 04 24             	mov    %eax,(%esp)
  104987:	e8 63 fb ff ff       	call   1044ef <get_pte>
  10498c:	89 45 f0             	mov    %eax,-0x10(%ebp)
  10498f:	83 7d f0 00          	cmpl   $0x0,-0x10(%ebp)
  104993:	75 24                	jne    1049b9 <check_pgdir+0x15b>
  104995:	c7 44 24 0c ec 6c 10 	movl   $0x106cec,0xc(%esp)
  10499c:	00 
  10499d:	c7 44 24 08 e9 6b 10 	movl   $0x106be9,0x8(%esp)
  1049a4:	00 
  1049a5:	c7 44 24 04 09 02 00 	movl   $0x209,0x4(%esp)
  1049ac:	00 
  1049ad:	c7 04 24 c4 6b 10 00 	movl   $0x106bc4,(%esp)
  1049b4:	e8 0d c3 ff ff       	call   100cc6 <__panic>
    assert(pa2page(*ptep) == p1);
  1049b9:	8b 45 f0             	mov    -0x10(%ebp),%eax
  1049bc:	8b 00                	mov    (%eax),%eax
  1049be:	89 04 24             	mov    %eax,(%esp)
  1049c1:	e8 04 f1 ff ff       	call   103aca <pa2page>
  1049c6:	3b 45 f4             	cmp    -0xc(%ebp),%eax
  1049c9:	74 24                	je     1049ef <check_pgdir+0x191>
  1049cb:	c7 44 24 0c 19 6d 10 	movl   $0x106d19,0xc(%esp)
  1049d2:	00 
  1049d3:	c7 44 24 08 e9 6b 10 	movl   $0x106be9,0x8(%esp)
  1049da:	00 
  1049db:	c7 44 24 04 0a 02 00 	movl   $0x20a,0x4(%esp)
  1049e2:	00 
  1049e3:	c7 04 24 c4 6b 10 00 	movl   $0x106bc4,(%esp)
  1049ea:	e8 d7 c2 ff ff       	call   100cc6 <__panic>
    assert(page_ref(p1) == 1);
  1049ef:	8b 45 f4             	mov    -0xc(%ebp),%eax
  1049f2:	89 04 24             	mov    %eax,(%esp)
  1049f5:	e8 b1 f1 ff ff       	call   103bab <page_ref>
  1049fa:	83 f8 01             	cmp    $0x1,%eax
  1049fd:	74 24                	je     104a23 <check_pgdir+0x1c5>
  1049ff:	c7 44 24 0c 2e 6d 10 	movl   $0x106d2e,0xc(%esp)
  104a06:	00 
  104a07:	c7 44 24 08 e9 6b 10 	movl   $0x106be9,0x8(%esp)
  104a0e:	00 
  104a0f:	c7 44 24 04 0b 02 00 	movl   $0x20b,0x4(%esp)
  104a16:	00 
  104a17:	c7 04 24 c4 6b 10 00 	movl   $0x106bc4,(%esp)
  104a1e:	e8 a3 c2 ff ff       	call   100cc6 <__panic>

    ptep = &((pte_t *)KADDR(PDE_ADDR(boot_pgdir[0])))[1];
  104a23:	a1 c4 88 11 00       	mov    0x1188c4,%eax
  104a28:	8b 00                	mov    (%eax),%eax
  104a2a:	25 00 f0 ff ff       	and    $0xfffff000,%eax
  104a2f:	89 45 ec             	mov    %eax,-0x14(%ebp)
  104a32:	8b 45 ec             	mov    -0x14(%ebp),%eax
  104a35:	c1 e8 0c             	shr    $0xc,%eax
  104a38:	89 45 e8             	mov    %eax,-0x18(%ebp)
  104a3b:	a1 c0 88 11 00       	mov    0x1188c0,%eax
  104a40:	39 45 e8             	cmp    %eax,-0x18(%ebp)
  104a43:	72 23                	jb     104a68 <check_pgdir+0x20a>
  104a45:	8b 45 ec             	mov    -0x14(%ebp),%eax
  104a48:	89 44 24 0c          	mov    %eax,0xc(%esp)
  104a4c:	c7 44 24 08 fc 6a 10 	movl   $0x106afc,0x8(%esp)
  104a53:	00 
  104a54:	c7 44 24 04 0d 02 00 	movl   $0x20d,0x4(%esp)
  104a5b:	00 
  104a5c:	c7 04 24 c4 6b 10 00 	movl   $0x106bc4,(%esp)
  104a63:	e8 5e c2 ff ff       	call   100cc6 <__panic>
  104a68:	8b 45 ec             	mov    -0x14(%ebp),%eax
  104a6b:	2d 00 00 00 40       	sub    $0x40000000,%eax
  104a70:	83 c0 04             	add    $0x4,%eax
  104a73:	89 45 f0             	mov    %eax,-0x10(%ebp)
    assert(get_pte(boot_pgdir, PGSIZE, 0) == ptep);
  104a76:	a1 c4 88 11 00       	mov    0x1188c4,%eax
  104a7b:	c7 44 24 08 00 00 00 	movl   $0x0,0x8(%esp)
  104a82:	00 
  104a83:	c7 44 24 04 00 10 00 	movl   $0x1000,0x4(%esp)
  104a8a:	00 
  104a8b:	89 04 24             	mov    %eax,(%esp)
  104a8e:	e8 5c fa ff ff       	call   1044ef <get_pte>
  104a93:	3b 45 f0             	cmp    -0x10(%ebp),%eax
  104a96:	74 24                	je     104abc <check_pgdir+0x25e>
  104a98:	c7 44 24 0c 40 6d 10 	movl   $0x106d40,0xc(%esp)
  104a9f:	00 
  104aa0:	c7 44 24 08 e9 6b 10 	movl   $0x106be9,0x8(%esp)
  104aa7:	00 
  104aa8:	c7 44 24 04 0e 02 00 	movl   $0x20e,0x4(%esp)
  104aaf:	00 
  104ab0:	c7 04 24 c4 6b 10 00 	movl   $0x106bc4,(%esp)
  104ab7:	e8 0a c2 ff ff       	call   100cc6 <__panic>

    p2 = alloc_page();
  104abc:	c7 04 24 01 00 00 00 	movl   $0x1,(%esp)
  104ac3:	e8 e8 f2 ff ff       	call   103db0 <alloc_pages>
  104ac8:	89 45 e4             	mov    %eax,-0x1c(%ebp)
    assert(page_insert(boot_pgdir, p2, PGSIZE, PTE_U | PTE_W) == 0);
  104acb:	a1 c4 88 11 00       	mov    0x1188c4,%eax
  104ad0:	c7 44 24 0c 06 00 00 	movl   $0x6,0xc(%esp)
  104ad7:	00 
  104ad8:	c7 44 24 08 00 10 00 	movl   $0x1000,0x8(%esp)
  104adf:	00 
  104ae0:	8b 55 e4             	mov    -0x1c(%ebp),%edx
  104ae3:	89 54 24 04          	mov    %edx,0x4(%esp)
  104ae7:	89 04 24             	mov    %eax,(%esp)
  104aea:	e8 3b fc ff ff       	call   10472a <page_insert>
  104aef:	85 c0                	test   %eax,%eax
  104af1:	74 24                	je     104b17 <check_pgdir+0x2b9>
  104af3:	c7 44 24 0c 68 6d 10 	movl   $0x106d68,0xc(%esp)
  104afa:	00 
  104afb:	c7 44 24 08 e9 6b 10 	movl   $0x106be9,0x8(%esp)
  104b02:	00 
  104b03:	c7 44 24 04 11 02 00 	movl   $0x211,0x4(%esp)
  104b0a:	00 
  104b0b:	c7 04 24 c4 6b 10 00 	movl   $0x106bc4,(%esp)
  104b12:	e8 af c1 ff ff       	call   100cc6 <__panic>
    assert((ptep = get_pte(boot_pgdir, PGSIZE, 0)) != NULL);
  104b17:	a1 c4 88 11 00       	mov    0x1188c4,%eax
  104b1c:	c7 44 24 08 00 00 00 	movl   $0x0,0x8(%esp)
  104b23:	00 
  104b24:	c7 44 24 04 00 10 00 	movl   $0x1000,0x4(%esp)
  104b2b:	00 
  104b2c:	89 04 24             	mov    %eax,(%esp)
  104b2f:	e8 bb f9 ff ff       	call   1044ef <get_pte>
  104b34:	89 45 f0             	mov    %eax,-0x10(%ebp)
  104b37:	83 7d f0 00          	cmpl   $0x0,-0x10(%ebp)
  104b3b:	75 24                	jne    104b61 <check_pgdir+0x303>
  104b3d:	c7 44 24 0c a0 6d 10 	movl   $0x106da0,0xc(%esp)
  104b44:	00 
  104b45:	c7 44 24 08 e9 6b 10 	movl   $0x106be9,0x8(%esp)
  104b4c:	00 
  104b4d:	c7 44 24 04 12 02 00 	movl   $0x212,0x4(%esp)
  104b54:	00 
  104b55:	c7 04 24 c4 6b 10 00 	movl   $0x106bc4,(%esp)
  104b5c:	e8 65 c1 ff ff       	call   100cc6 <__panic>
    assert(*ptep & PTE_U);
  104b61:	8b 45 f0             	mov    -0x10(%ebp),%eax
  104b64:	8b 00                	mov    (%eax),%eax
  104b66:	83 e0 04             	and    $0x4,%eax
  104b69:	85 c0                	test   %eax,%eax
  104b6b:	75 24                	jne    104b91 <check_pgdir+0x333>
  104b6d:	c7 44 24 0c d0 6d 10 	movl   $0x106dd0,0xc(%esp)
  104b74:	00 
  104b75:	c7 44 24 08 e9 6b 10 	movl   $0x106be9,0x8(%esp)
  104b7c:	00 
  104b7d:	c7 44 24 04 13 02 00 	movl   $0x213,0x4(%esp)
  104b84:	00 
  104b85:	c7 04 24 c4 6b 10 00 	movl   $0x106bc4,(%esp)
  104b8c:	e8 35 c1 ff ff       	call   100cc6 <__panic>
    assert(*ptep & PTE_W);
  104b91:	8b 45 f0             	mov    -0x10(%ebp),%eax
  104b94:	8b 00                	mov    (%eax),%eax
  104b96:	83 e0 02             	and    $0x2,%eax
  104b99:	85 c0                	test   %eax,%eax
  104b9b:	75 24                	jne    104bc1 <check_pgdir+0x363>
  104b9d:	c7 44 24 0c de 6d 10 	movl   $0x106dde,0xc(%esp)
  104ba4:	00 
  104ba5:	c7 44 24 08 e9 6b 10 	movl   $0x106be9,0x8(%esp)
  104bac:	00 
  104bad:	c7 44 24 04 14 02 00 	movl   $0x214,0x4(%esp)
  104bb4:	00 
  104bb5:	c7 04 24 c4 6b 10 00 	movl   $0x106bc4,(%esp)
  104bbc:	e8 05 c1 ff ff       	call   100cc6 <__panic>
    assert(boot_pgdir[0] & PTE_U);
  104bc1:	a1 c4 88 11 00       	mov    0x1188c4,%eax
  104bc6:	8b 00                	mov    (%eax),%eax
  104bc8:	83 e0 04             	and    $0x4,%eax
  104bcb:	85 c0                	test   %eax,%eax
  104bcd:	75 24                	jne    104bf3 <check_pgdir+0x395>
  104bcf:	c7 44 24 0c ec 6d 10 	movl   $0x106dec,0xc(%esp)
  104bd6:	00 
  104bd7:	c7 44 24 08 e9 6b 10 	movl   $0x106be9,0x8(%esp)
  104bde:	00 
  104bdf:	c7 44 24 04 15 02 00 	movl   $0x215,0x4(%esp)
  104be6:	00 
  104be7:	c7 04 24 c4 6b 10 00 	movl   $0x106bc4,(%esp)
  104bee:	e8 d3 c0 ff ff       	call   100cc6 <__panic>
    assert(page_ref(p2) == 1);
  104bf3:	8b 45 e4             	mov    -0x1c(%ebp),%eax
  104bf6:	89 04 24             	mov    %eax,(%esp)
  104bf9:	e8 ad ef ff ff       	call   103bab <page_ref>
  104bfe:	83 f8 01             	cmp    $0x1,%eax
  104c01:	74 24                	je     104c27 <check_pgdir+0x3c9>
  104c03:	c7 44 24 0c 02 6e 10 	movl   $0x106e02,0xc(%esp)
  104c0a:	00 
  104c0b:	c7 44 24 08 e9 6b 10 	movl   $0x106be9,0x8(%esp)
  104c12:	00 
  104c13:	c7 44 24 04 16 02 00 	movl   $0x216,0x4(%esp)
  104c1a:	00 
  104c1b:	c7 04 24 c4 6b 10 00 	movl   $0x106bc4,(%esp)
  104c22:	e8 9f c0 ff ff       	call   100cc6 <__panic>

    assert(page_insert(boot_pgdir, p1, PGSIZE, 0) == 0);
  104c27:	a1 c4 88 11 00       	mov    0x1188c4,%eax
  104c2c:	c7 44 24 0c 00 00 00 	movl   $0x0,0xc(%esp)
  104c33:	00 
  104c34:	c7 44 24 08 00 10 00 	movl   $0x1000,0x8(%esp)
  104c3b:	00 
  104c3c:	8b 55 f4             	mov    -0xc(%ebp),%edx
  104c3f:	89 54 24 04          	mov    %edx,0x4(%esp)
  104c43:	89 04 24             	mov    %eax,(%esp)
  104c46:	e8 df fa ff ff       	call   10472a <page_insert>
  104c4b:	85 c0                	test   %eax,%eax
  104c4d:	74 24                	je     104c73 <check_pgdir+0x415>
  104c4f:	c7 44 24 0c 14 6e 10 	movl   $0x106e14,0xc(%esp)
  104c56:	00 
  104c57:	c7 44 24 08 e9 6b 10 	movl   $0x106be9,0x8(%esp)
  104c5e:	00 
  104c5f:	c7 44 24 04 18 02 00 	movl   $0x218,0x4(%esp)
  104c66:	00 
  104c67:	c7 04 24 c4 6b 10 00 	movl   $0x106bc4,(%esp)
  104c6e:	e8 53 c0 ff ff       	call   100cc6 <__panic>
    assert(page_ref(p1) == 2);
  104c73:	8b 45 f4             	mov    -0xc(%ebp),%eax
  104c76:	89 04 24             	mov    %eax,(%esp)
  104c79:	e8 2d ef ff ff       	call   103bab <page_ref>
  104c7e:	83 f8 02             	cmp    $0x2,%eax
  104c81:	74 24                	je     104ca7 <check_pgdir+0x449>
  104c83:	c7 44 24 0c 40 6e 10 	movl   $0x106e40,0xc(%esp)
  104c8a:	00 
  104c8b:	c7 44 24 08 e9 6b 10 	movl   $0x106be9,0x8(%esp)
  104c92:	00 
  104c93:	c7 44 24 04 19 02 00 	movl   $0x219,0x4(%esp)
  104c9a:	00 
  104c9b:	c7 04 24 c4 6b 10 00 	movl   $0x106bc4,(%esp)
  104ca2:	e8 1f c0 ff ff       	call   100cc6 <__panic>
    assert(page_ref(p2) == 0);
  104ca7:	8b 45 e4             	mov    -0x1c(%ebp),%eax
  104caa:	89 04 24             	mov    %eax,(%esp)
  104cad:	e8 f9 ee ff ff       	call   103bab <page_ref>
  104cb2:	85 c0                	test   %eax,%eax
  104cb4:	74 24                	je     104cda <check_pgdir+0x47c>
  104cb6:	c7 44 24 0c 52 6e 10 	movl   $0x106e52,0xc(%esp)
  104cbd:	00 
  104cbe:	c7 44 24 08 e9 6b 10 	movl   $0x106be9,0x8(%esp)
  104cc5:	00 
  104cc6:	c7 44 24 04 1a 02 00 	movl   $0x21a,0x4(%esp)
  104ccd:	00 
  104cce:	c7 04 24 c4 6b 10 00 	movl   $0x106bc4,(%esp)
  104cd5:	e8 ec bf ff ff       	call   100cc6 <__panic>
    assert((ptep = get_pte(boot_pgdir, PGSIZE, 0)) != NULL);
  104cda:	a1 c4 88 11 00       	mov    0x1188c4,%eax
  104cdf:	c7 44 24 08 00 00 00 	movl   $0x0,0x8(%esp)
  104ce6:	00 
  104ce7:	c7 44 24 04 00 10 00 	movl   $0x1000,0x4(%esp)
  104cee:	00 
  104cef:	89 04 24             	mov    %eax,(%esp)
  104cf2:	e8 f8 f7 ff ff       	call   1044ef <get_pte>
  104cf7:	89 45 f0             	mov    %eax,-0x10(%ebp)
  104cfa:	83 7d f0 00          	cmpl   $0x0,-0x10(%ebp)
  104cfe:	75 24                	jne    104d24 <check_pgdir+0x4c6>
  104d00:	c7 44 24 0c a0 6d 10 	movl   $0x106da0,0xc(%esp)
  104d07:	00 
  104d08:	c7 44 24 08 e9 6b 10 	movl   $0x106be9,0x8(%esp)
  104d0f:	00 
  104d10:	c7 44 24 04 1b 02 00 	movl   $0x21b,0x4(%esp)
  104d17:	00 
  104d18:	c7 04 24 c4 6b 10 00 	movl   $0x106bc4,(%esp)
  104d1f:	e8 a2 bf ff ff       	call   100cc6 <__panic>
    assert(pa2page(*ptep) == p1);
  104d24:	8b 45 f0             	mov    -0x10(%ebp),%eax
  104d27:	8b 00                	mov    (%eax),%eax
  104d29:	89 04 24             	mov    %eax,(%esp)
  104d2c:	e8 99 ed ff ff       	call   103aca <pa2page>
  104d31:	3b 45 f4             	cmp    -0xc(%ebp),%eax
  104d34:	74 24                	je     104d5a <check_pgdir+0x4fc>
  104d36:	c7 44 24 0c 19 6d 10 	movl   $0x106d19,0xc(%esp)
  104d3d:	00 
  104d3e:	c7 44 24 08 e9 6b 10 	movl   $0x106be9,0x8(%esp)
  104d45:	00 
  104d46:	c7 44 24 04 1c 02 00 	movl   $0x21c,0x4(%esp)
  104d4d:	00 
  104d4e:	c7 04 24 c4 6b 10 00 	movl   $0x106bc4,(%esp)
  104d55:	e8 6c bf ff ff       	call   100cc6 <__panic>
    assert((*ptep & PTE_U) == 0);
  104d5a:	8b 45 f0             	mov    -0x10(%ebp),%eax
  104d5d:	8b 00                	mov    (%eax),%eax
  104d5f:	83 e0 04             	and    $0x4,%eax
  104d62:	85 c0                	test   %eax,%eax
  104d64:	74 24                	je     104d8a <check_pgdir+0x52c>
  104d66:	c7 44 24 0c 64 6e 10 	movl   $0x106e64,0xc(%esp)
  104d6d:	00 
  104d6e:	c7 44 24 08 e9 6b 10 	movl   $0x106be9,0x8(%esp)
  104d75:	00 
  104d76:	c7 44 24 04 1d 02 00 	movl   $0x21d,0x4(%esp)
  104d7d:	00 
  104d7e:	c7 04 24 c4 6b 10 00 	movl   $0x106bc4,(%esp)
  104d85:	e8 3c bf ff ff       	call   100cc6 <__panic>

    page_remove(boot_pgdir, 0x0);
  104d8a:	a1 c4 88 11 00       	mov    0x1188c4,%eax
  104d8f:	c7 44 24 04 00 00 00 	movl   $0x0,0x4(%esp)
  104d96:	00 
  104d97:	89 04 24             	mov    %eax,(%esp)
  104d9a:	e8 47 f9 ff ff       	call   1046e6 <page_remove>
    assert(page_ref(p1) == 1);
  104d9f:	8b 45 f4             	mov    -0xc(%ebp),%eax
  104da2:	89 04 24             	mov    %eax,(%esp)
  104da5:	e8 01 ee ff ff       	call   103bab <page_ref>
  104daa:	83 f8 01             	cmp    $0x1,%eax
  104dad:	74 24                	je     104dd3 <check_pgdir+0x575>
  104daf:	c7 44 24 0c 2e 6d 10 	movl   $0x106d2e,0xc(%esp)
  104db6:	00 
  104db7:	c7 44 24 08 e9 6b 10 	movl   $0x106be9,0x8(%esp)
  104dbe:	00 
  104dbf:	c7 44 24 04 20 02 00 	movl   $0x220,0x4(%esp)
  104dc6:	00 
  104dc7:	c7 04 24 c4 6b 10 00 	movl   $0x106bc4,(%esp)
  104dce:	e8 f3 be ff ff       	call   100cc6 <__panic>
    assert(page_ref(p2) == 0);
  104dd3:	8b 45 e4             	mov    -0x1c(%ebp),%eax
  104dd6:	89 04 24             	mov    %eax,(%esp)
  104dd9:	e8 cd ed ff ff       	call   103bab <page_ref>
  104dde:	85 c0                	test   %eax,%eax
  104de0:	74 24                	je     104e06 <check_pgdir+0x5a8>
  104de2:	c7 44 24 0c 52 6e 10 	movl   $0x106e52,0xc(%esp)
  104de9:	00 
  104dea:	c7 44 24 08 e9 6b 10 	movl   $0x106be9,0x8(%esp)
  104df1:	00 
  104df2:	c7 44 24 04 21 02 00 	movl   $0x221,0x4(%esp)
  104df9:	00 
  104dfa:	c7 04 24 c4 6b 10 00 	movl   $0x106bc4,(%esp)
  104e01:	e8 c0 be ff ff       	call   100cc6 <__panic>

    page_remove(boot_pgdir, PGSIZE);
  104e06:	a1 c4 88 11 00       	mov    0x1188c4,%eax
  104e0b:	c7 44 24 04 00 10 00 	movl   $0x1000,0x4(%esp)
  104e12:	00 
  104e13:	89 04 24             	mov    %eax,(%esp)
  104e16:	e8 cb f8 ff ff       	call   1046e6 <page_remove>
    assert(page_ref(p1) == 0);
  104e1b:	8b 45 f4             	mov    -0xc(%ebp),%eax
  104e1e:	89 04 24             	mov    %eax,(%esp)
  104e21:	e8 85 ed ff ff       	call   103bab <page_ref>
  104e26:	85 c0                	test   %eax,%eax
  104e28:	74 24                	je     104e4e <check_pgdir+0x5f0>
  104e2a:	c7 44 24 0c 79 6e 10 	movl   $0x106e79,0xc(%esp)
  104e31:	00 
  104e32:	c7 44 24 08 e9 6b 10 	movl   $0x106be9,0x8(%esp)
  104e39:	00 
  104e3a:	c7 44 24 04 24 02 00 	movl   $0x224,0x4(%esp)
  104e41:	00 
  104e42:	c7 04 24 c4 6b 10 00 	movl   $0x106bc4,(%esp)
  104e49:	e8 78 be ff ff       	call   100cc6 <__panic>
    assert(page_ref(p2) == 0);
  104e4e:	8b 45 e4             	mov    -0x1c(%ebp),%eax
  104e51:	89 04 24             	mov    %eax,(%esp)
  104e54:	e8 52 ed ff ff       	call   103bab <page_ref>
  104e59:	85 c0                	test   %eax,%eax
  104e5b:	74 24                	je     104e81 <check_pgdir+0x623>
  104e5d:	c7 44 24 0c 52 6e 10 	movl   $0x106e52,0xc(%esp)
  104e64:	00 
  104e65:	c7 44 24 08 e9 6b 10 	movl   $0x106be9,0x8(%esp)
  104e6c:	00 
  104e6d:	c7 44 24 04 25 02 00 	movl   $0x225,0x4(%esp)
  104e74:	00 
  104e75:	c7 04 24 c4 6b 10 00 	movl   $0x106bc4,(%esp)
  104e7c:	e8 45 be ff ff       	call   100cc6 <__panic>

    assert(page_ref(pa2page(boot_pgdir[0])) == 1);
  104e81:	a1 c4 88 11 00       	mov    0x1188c4,%eax
  104e86:	8b 00                	mov    (%eax),%eax
  104e88:	89 04 24             	mov    %eax,(%esp)
  104e8b:	e8 3a ec ff ff       	call   103aca <pa2page>
  104e90:	89 04 24             	mov    %eax,(%esp)
  104e93:	e8 13 ed ff ff       	call   103bab <page_ref>
  104e98:	83 f8 01             	cmp    $0x1,%eax
  104e9b:	74 24                	je     104ec1 <check_pgdir+0x663>
  104e9d:	c7 44 24 0c 8c 6e 10 	movl   $0x106e8c,0xc(%esp)
  104ea4:	00 
  104ea5:	c7 44 24 08 e9 6b 10 	movl   $0x106be9,0x8(%esp)
  104eac:	00 
  104ead:	c7 44 24 04 27 02 00 	movl   $0x227,0x4(%esp)
  104eb4:	00 
  104eb5:	c7 04 24 c4 6b 10 00 	movl   $0x106bc4,(%esp)
  104ebc:	e8 05 be ff ff       	call   100cc6 <__panic>
    free_page(pa2page(boot_pgdir[0]));
  104ec1:	a1 c4 88 11 00       	mov    0x1188c4,%eax
  104ec6:	8b 00                	mov    (%eax),%eax
  104ec8:	89 04 24             	mov    %eax,(%esp)
  104ecb:	e8 fa eb ff ff       	call   103aca <pa2page>
  104ed0:	c7 44 24 04 01 00 00 	movl   $0x1,0x4(%esp)
  104ed7:	00 
  104ed8:	89 04 24             	mov    %eax,(%esp)
  104edb:	e8 08 ef ff ff       	call   103de8 <free_pages>
    boot_pgdir[0] = 0;
  104ee0:	a1 c4 88 11 00       	mov    0x1188c4,%eax
  104ee5:	c7 00 00 00 00 00    	movl   $0x0,(%eax)

    cprintf("check_pgdir() succeeded!\n");
  104eeb:	c7 04 24 b2 6e 10 00 	movl   $0x106eb2,(%esp)
  104ef2:	e8 45 b4 ff ff       	call   10033c <cprintf>
}
  104ef7:	c9                   	leave  
  104ef8:	c3                   	ret    

00104ef9 <check_boot_pgdir>:

static void
check_boot_pgdir(void) {
  104ef9:	55                   	push   %ebp
  104efa:	89 e5                	mov    %esp,%ebp
  104efc:	83 ec 38             	sub    $0x38,%esp
    pte_t *ptep;
    int i;
    for (i = 0; i < npage; i += PGSIZE) {
  104eff:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)
  104f06:	e9 ca 00 00 00       	jmp    104fd5 <check_boot_pgdir+0xdc>
        assert((ptep = get_pte(boot_pgdir, (uintptr_t)KADDR(i), 0)) != NULL);
  104f0b:	8b 45 f4             	mov    -0xc(%ebp),%eax
  104f0e:	89 45 f0             	mov    %eax,-0x10(%ebp)
  104f11:	8b 45 f0             	mov    -0x10(%ebp),%eax
  104f14:	c1 e8 0c             	shr    $0xc,%eax
  104f17:	89 45 ec             	mov    %eax,-0x14(%ebp)
  104f1a:	a1 c0 88 11 00       	mov    0x1188c0,%eax
  104f1f:	39 45 ec             	cmp    %eax,-0x14(%ebp)
  104f22:	72 23                	jb     104f47 <check_boot_pgdir+0x4e>
  104f24:	8b 45 f0             	mov    -0x10(%ebp),%eax
  104f27:	89 44 24 0c          	mov    %eax,0xc(%esp)
  104f2b:	c7 44 24 08 fc 6a 10 	movl   $0x106afc,0x8(%esp)
  104f32:	00 
  104f33:	c7 44 24 04 33 02 00 	movl   $0x233,0x4(%esp)
  104f3a:	00 
  104f3b:	c7 04 24 c4 6b 10 00 	movl   $0x106bc4,(%esp)
  104f42:	e8 7f bd ff ff       	call   100cc6 <__panic>
  104f47:	8b 45 f0             	mov    -0x10(%ebp),%eax
  104f4a:	2d 00 00 00 40       	sub    $0x40000000,%eax
  104f4f:	89 c2                	mov    %eax,%edx
  104f51:	a1 c4 88 11 00       	mov    0x1188c4,%eax
  104f56:	c7 44 24 08 00 00 00 	movl   $0x0,0x8(%esp)
  104f5d:	00 
  104f5e:	89 54 24 04          	mov    %edx,0x4(%esp)
  104f62:	89 04 24             	mov    %eax,(%esp)
  104f65:	e8 85 f5 ff ff       	call   1044ef <get_pte>
  104f6a:	89 45 e8             	mov    %eax,-0x18(%ebp)
  104f6d:	83 7d e8 00          	cmpl   $0x0,-0x18(%ebp)
  104f71:	75 24                	jne    104f97 <check_boot_pgdir+0x9e>
  104f73:	c7 44 24 0c cc 6e 10 	movl   $0x106ecc,0xc(%esp)
  104f7a:	00 
  104f7b:	c7 44 24 08 e9 6b 10 	movl   $0x106be9,0x8(%esp)
  104f82:	00 
  104f83:	c7 44 24 04 33 02 00 	movl   $0x233,0x4(%esp)
  104f8a:	00 
  104f8b:	c7 04 24 c4 6b 10 00 	movl   $0x106bc4,(%esp)
  104f92:	e8 2f bd ff ff       	call   100cc6 <__panic>
        assert(PTE_ADDR(*ptep) == i);
  104f97:	8b 45 e8             	mov    -0x18(%ebp),%eax
  104f9a:	8b 00                	mov    (%eax),%eax
  104f9c:	25 00 f0 ff ff       	and    $0xfffff000,%eax
  104fa1:	89 c2                	mov    %eax,%edx
  104fa3:	8b 45 f4             	mov    -0xc(%ebp),%eax
  104fa6:	39 c2                	cmp    %eax,%edx
  104fa8:	74 24                	je     104fce <check_boot_pgdir+0xd5>
  104faa:	c7 44 24 0c 09 6f 10 	movl   $0x106f09,0xc(%esp)
  104fb1:	00 
  104fb2:	c7 44 24 08 e9 6b 10 	movl   $0x106be9,0x8(%esp)
  104fb9:	00 
  104fba:	c7 44 24 04 34 02 00 	movl   $0x234,0x4(%esp)
  104fc1:	00 
  104fc2:	c7 04 24 c4 6b 10 00 	movl   $0x106bc4,(%esp)
  104fc9:	e8 f8 bc ff ff       	call   100cc6 <__panic>

static void
check_boot_pgdir(void) {
    pte_t *ptep;
    int i;
    for (i = 0; i < npage; i += PGSIZE) {
  104fce:	81 45 f4 00 10 00 00 	addl   $0x1000,-0xc(%ebp)
  104fd5:	8b 55 f4             	mov    -0xc(%ebp),%edx
  104fd8:	a1 c0 88 11 00       	mov    0x1188c0,%eax
  104fdd:	39 c2                	cmp    %eax,%edx
  104fdf:	0f 82 26 ff ff ff    	jb     104f0b <check_boot_pgdir+0x12>
        assert((ptep = get_pte(boot_pgdir, (uintptr_t)KADDR(i), 0)) != NULL);
        assert(PTE_ADDR(*ptep) == i);
    }

    assert(PDE_ADDR(boot_pgdir[PDX(VPT)]) == PADDR(boot_pgdir));
  104fe5:	a1 c4 88 11 00       	mov    0x1188c4,%eax
  104fea:	05 ac 0f 00 00       	add    $0xfac,%eax
  104fef:	8b 00                	mov    (%eax),%eax
  104ff1:	25 00 f0 ff ff       	and    $0xfffff000,%eax
  104ff6:	89 c2                	mov    %eax,%edx
  104ff8:	a1 c4 88 11 00       	mov    0x1188c4,%eax
  104ffd:	89 45 e4             	mov    %eax,-0x1c(%ebp)
  105000:	81 7d e4 ff ff ff bf 	cmpl   $0xbfffffff,-0x1c(%ebp)
  105007:	77 23                	ja     10502c <check_boot_pgdir+0x133>
  105009:	8b 45 e4             	mov    -0x1c(%ebp),%eax
  10500c:	89 44 24 0c          	mov    %eax,0xc(%esp)
  105010:	c7 44 24 08 a0 6b 10 	movl   $0x106ba0,0x8(%esp)
  105017:	00 
  105018:	c7 44 24 04 37 02 00 	movl   $0x237,0x4(%esp)
  10501f:	00 
  105020:	c7 04 24 c4 6b 10 00 	movl   $0x106bc4,(%esp)
  105027:	e8 9a bc ff ff       	call   100cc6 <__panic>
  10502c:	8b 45 e4             	mov    -0x1c(%ebp),%eax
  10502f:	05 00 00 00 40       	add    $0x40000000,%eax
  105034:	39 c2                	cmp    %eax,%edx
  105036:	74 24                	je     10505c <check_boot_pgdir+0x163>
  105038:	c7 44 24 0c 20 6f 10 	movl   $0x106f20,0xc(%esp)
  10503f:	00 
  105040:	c7 44 24 08 e9 6b 10 	movl   $0x106be9,0x8(%esp)
  105047:	00 
  105048:	c7 44 24 04 37 02 00 	movl   $0x237,0x4(%esp)
  10504f:	00 
  105050:	c7 04 24 c4 6b 10 00 	movl   $0x106bc4,(%esp)
  105057:	e8 6a bc ff ff       	call   100cc6 <__panic>

    assert(boot_pgdir[0] == 0);
  10505c:	a1 c4 88 11 00       	mov    0x1188c4,%eax
  105061:	8b 00                	mov    (%eax),%eax
  105063:	85 c0                	test   %eax,%eax
  105065:	74 24                	je     10508b <check_boot_pgdir+0x192>
  105067:	c7 44 24 0c 54 6f 10 	movl   $0x106f54,0xc(%esp)
  10506e:	00 
  10506f:	c7 44 24 08 e9 6b 10 	movl   $0x106be9,0x8(%esp)
  105076:	00 
  105077:	c7 44 24 04 39 02 00 	movl   $0x239,0x4(%esp)
  10507e:	00 
  10507f:	c7 04 24 c4 6b 10 00 	movl   $0x106bc4,(%esp)
  105086:	e8 3b bc ff ff       	call   100cc6 <__panic>

    struct Page *p;
    p = alloc_page();
  10508b:	c7 04 24 01 00 00 00 	movl   $0x1,(%esp)
  105092:	e8 19 ed ff ff       	call   103db0 <alloc_pages>
  105097:	89 45 e0             	mov    %eax,-0x20(%ebp)
    assert(page_insert(boot_pgdir, p, 0x100, PTE_W) == 0);
  10509a:	a1 c4 88 11 00       	mov    0x1188c4,%eax
  10509f:	c7 44 24 0c 02 00 00 	movl   $0x2,0xc(%esp)
  1050a6:	00 
  1050a7:	c7 44 24 08 00 01 00 	movl   $0x100,0x8(%esp)
  1050ae:	00 
  1050af:	8b 55 e0             	mov    -0x20(%ebp),%edx
  1050b2:	89 54 24 04          	mov    %edx,0x4(%esp)
  1050b6:	89 04 24             	mov    %eax,(%esp)
  1050b9:	e8 6c f6 ff ff       	call   10472a <page_insert>
  1050be:	85 c0                	test   %eax,%eax
  1050c0:	74 24                	je     1050e6 <check_boot_pgdir+0x1ed>
  1050c2:	c7 44 24 0c 68 6f 10 	movl   $0x106f68,0xc(%esp)
  1050c9:	00 
  1050ca:	c7 44 24 08 e9 6b 10 	movl   $0x106be9,0x8(%esp)
  1050d1:	00 
  1050d2:	c7 44 24 04 3d 02 00 	movl   $0x23d,0x4(%esp)
  1050d9:	00 
  1050da:	c7 04 24 c4 6b 10 00 	movl   $0x106bc4,(%esp)
  1050e1:	e8 e0 bb ff ff       	call   100cc6 <__panic>
    assert(page_ref(p) == 1);
  1050e6:	8b 45 e0             	mov    -0x20(%ebp),%eax
  1050e9:	89 04 24             	mov    %eax,(%esp)
  1050ec:	e8 ba ea ff ff       	call   103bab <page_ref>
  1050f1:	83 f8 01             	cmp    $0x1,%eax
  1050f4:	74 24                	je     10511a <check_boot_pgdir+0x221>
  1050f6:	c7 44 24 0c 96 6f 10 	movl   $0x106f96,0xc(%esp)
  1050fd:	00 
  1050fe:	c7 44 24 08 e9 6b 10 	movl   $0x106be9,0x8(%esp)
  105105:	00 
  105106:	c7 44 24 04 3e 02 00 	movl   $0x23e,0x4(%esp)
  10510d:	00 
  10510e:	c7 04 24 c4 6b 10 00 	movl   $0x106bc4,(%esp)
  105115:	e8 ac bb ff ff       	call   100cc6 <__panic>
    assert(page_insert(boot_pgdir, p, 0x100 + PGSIZE, PTE_W) == 0);
  10511a:	a1 c4 88 11 00       	mov    0x1188c4,%eax
  10511f:	c7 44 24 0c 02 00 00 	movl   $0x2,0xc(%esp)
  105126:	00 
  105127:	c7 44 24 08 00 11 00 	movl   $0x1100,0x8(%esp)
  10512e:	00 
  10512f:	8b 55 e0             	mov    -0x20(%ebp),%edx
  105132:	89 54 24 04          	mov    %edx,0x4(%esp)
  105136:	89 04 24             	mov    %eax,(%esp)
  105139:	e8 ec f5 ff ff       	call   10472a <page_insert>
  10513e:	85 c0                	test   %eax,%eax
  105140:	74 24                	je     105166 <check_boot_pgdir+0x26d>
  105142:	c7 44 24 0c a8 6f 10 	movl   $0x106fa8,0xc(%esp)
  105149:	00 
  10514a:	c7 44 24 08 e9 6b 10 	movl   $0x106be9,0x8(%esp)
  105151:	00 
  105152:	c7 44 24 04 3f 02 00 	movl   $0x23f,0x4(%esp)
  105159:	00 
  10515a:	c7 04 24 c4 6b 10 00 	movl   $0x106bc4,(%esp)
  105161:	e8 60 bb ff ff       	call   100cc6 <__panic>
    assert(page_ref(p) == 2);
  105166:	8b 45 e0             	mov    -0x20(%ebp),%eax
  105169:	89 04 24             	mov    %eax,(%esp)
  10516c:	e8 3a ea ff ff       	call   103bab <page_ref>
  105171:	83 f8 02             	cmp    $0x2,%eax
  105174:	74 24                	je     10519a <check_boot_pgdir+0x2a1>
  105176:	c7 44 24 0c df 6f 10 	movl   $0x106fdf,0xc(%esp)
  10517d:	00 
  10517e:	c7 44 24 08 e9 6b 10 	movl   $0x106be9,0x8(%esp)
  105185:	00 
  105186:	c7 44 24 04 40 02 00 	movl   $0x240,0x4(%esp)
  10518d:	00 
  10518e:	c7 04 24 c4 6b 10 00 	movl   $0x106bc4,(%esp)
  105195:	e8 2c bb ff ff       	call   100cc6 <__panic>

    const char *str = "ucore: Hello world!!";
  10519a:	c7 45 dc f0 6f 10 00 	movl   $0x106ff0,-0x24(%ebp)
    strcpy((void *)0x100, str);
  1051a1:	8b 45 dc             	mov    -0x24(%ebp),%eax
  1051a4:	89 44 24 04          	mov    %eax,0x4(%esp)
  1051a8:	c7 04 24 00 01 00 00 	movl   $0x100,(%esp)
  1051af:	e8 1e 0a 00 00       	call   105bd2 <strcpy>
    assert(strcmp((void *)0x100, (void *)(0x100 + PGSIZE)) == 0);
  1051b4:	c7 44 24 04 00 11 00 	movl   $0x1100,0x4(%esp)
  1051bb:	00 
  1051bc:	c7 04 24 00 01 00 00 	movl   $0x100,(%esp)
  1051c3:	e8 83 0a 00 00       	call   105c4b <strcmp>
  1051c8:	85 c0                	test   %eax,%eax
  1051ca:	74 24                	je     1051f0 <check_boot_pgdir+0x2f7>
  1051cc:	c7 44 24 0c 08 70 10 	movl   $0x107008,0xc(%esp)
  1051d3:	00 
  1051d4:	c7 44 24 08 e9 6b 10 	movl   $0x106be9,0x8(%esp)
  1051db:	00 
  1051dc:	c7 44 24 04 44 02 00 	movl   $0x244,0x4(%esp)
  1051e3:	00 
  1051e4:	c7 04 24 c4 6b 10 00 	movl   $0x106bc4,(%esp)
  1051eb:	e8 d6 ba ff ff       	call   100cc6 <__panic>

    *(char *)(page2kva(p) + 0x100) = '\0';
  1051f0:	8b 45 e0             	mov    -0x20(%ebp),%eax
  1051f3:	89 04 24             	mov    %eax,(%esp)
  1051f6:	e8 1e e9 ff ff       	call   103b19 <page2kva>
  1051fb:	05 00 01 00 00       	add    $0x100,%eax
  105200:	c6 00 00             	movb   $0x0,(%eax)
    assert(strlen((const char *)0x100) == 0);
  105203:	c7 04 24 00 01 00 00 	movl   $0x100,(%esp)
  10520a:	e8 6b 09 00 00       	call   105b7a <strlen>
  10520f:	85 c0                	test   %eax,%eax
  105211:	74 24                	je     105237 <check_boot_pgdir+0x33e>
  105213:	c7 44 24 0c 40 70 10 	movl   $0x107040,0xc(%esp)
  10521a:	00 
  10521b:	c7 44 24 08 e9 6b 10 	movl   $0x106be9,0x8(%esp)
  105222:	00 
  105223:	c7 44 24 04 47 02 00 	movl   $0x247,0x4(%esp)
  10522a:	00 
  10522b:	c7 04 24 c4 6b 10 00 	movl   $0x106bc4,(%esp)
  105232:	e8 8f ba ff ff       	call   100cc6 <__panic>

    free_page(p);
  105237:	c7 44 24 04 01 00 00 	movl   $0x1,0x4(%esp)
  10523e:	00 
  10523f:	8b 45 e0             	mov    -0x20(%ebp),%eax
  105242:	89 04 24             	mov    %eax,(%esp)
  105245:	e8 9e eb ff ff       	call   103de8 <free_pages>
    free_page(pa2page(PDE_ADDR(boot_pgdir[0])));
  10524a:	a1 c4 88 11 00       	mov    0x1188c4,%eax
  10524f:	8b 00                	mov    (%eax),%eax
  105251:	25 00 f0 ff ff       	and    $0xfffff000,%eax
  105256:	89 04 24             	mov    %eax,(%esp)
  105259:	e8 6c e8 ff ff       	call   103aca <pa2page>
  10525e:	c7 44 24 04 01 00 00 	movl   $0x1,0x4(%esp)
  105265:	00 
  105266:	89 04 24             	mov    %eax,(%esp)
  105269:	e8 7a eb ff ff       	call   103de8 <free_pages>
    boot_pgdir[0] = 0;
  10526e:	a1 c4 88 11 00       	mov    0x1188c4,%eax
  105273:	c7 00 00 00 00 00    	movl   $0x0,(%eax)

    cprintf("check_boot_pgdir() succeeded!\n");
  105279:	c7 04 24 64 70 10 00 	movl   $0x107064,(%esp)
  105280:	e8 b7 b0 ff ff       	call   10033c <cprintf>
}
  105285:	c9                   	leave  
  105286:	c3                   	ret    

00105287 <perm2str>:

//perm2str - use string 'u,r,w,-' to present the permission
static const char *
perm2str(int perm) {
  105287:	55                   	push   %ebp
  105288:	89 e5                	mov    %esp,%ebp
    static char str[4];
    str[0] = (perm & PTE_U) ? 'u' : '-';
  10528a:	8b 45 08             	mov    0x8(%ebp),%eax
  10528d:	83 e0 04             	and    $0x4,%eax
  105290:	85 c0                	test   %eax,%eax
  105292:	74 07                	je     10529b <perm2str+0x14>
  105294:	b8 75 00 00 00       	mov    $0x75,%eax
  105299:	eb 05                	jmp    1052a0 <perm2str+0x19>
  10529b:	b8 2d 00 00 00       	mov    $0x2d,%eax
  1052a0:	a2 48 89 11 00       	mov    %al,0x118948
    str[1] = 'r';
  1052a5:	c6 05 49 89 11 00 72 	movb   $0x72,0x118949
    str[2] = (perm & PTE_W) ? 'w' : '-';
  1052ac:	8b 45 08             	mov    0x8(%ebp),%eax
  1052af:	83 e0 02             	and    $0x2,%eax
  1052b2:	85 c0                	test   %eax,%eax
  1052b4:	74 07                	je     1052bd <perm2str+0x36>
  1052b6:	b8 77 00 00 00       	mov    $0x77,%eax
  1052bb:	eb 05                	jmp    1052c2 <perm2str+0x3b>
  1052bd:	b8 2d 00 00 00       	mov    $0x2d,%eax
  1052c2:	a2 4a 89 11 00       	mov    %al,0x11894a
    str[3] = '\0';
  1052c7:	c6 05 4b 89 11 00 00 	movb   $0x0,0x11894b
    return str;
  1052ce:	b8 48 89 11 00       	mov    $0x118948,%eax
}
  1052d3:	5d                   	pop    %ebp
  1052d4:	c3                   	ret    

001052d5 <get_pgtable_items>:
//  table:       the beginning addr of table
//  left_store:  the pointer of the high side of table's next range
//  right_store: the pointer of the low side of table's next range
// return value: 0 - not a invalid item range, perm - a valid item range with perm permission 
static int
get_pgtable_items(size_t left, size_t right, size_t start, uintptr_t *table, size_t *left_store, size_t *right_store) {
  1052d5:	55                   	push   %ebp
  1052d6:	89 e5                	mov    %esp,%ebp
  1052d8:	83 ec 10             	sub    $0x10,%esp
    if (start >= right) {
  1052db:	8b 45 10             	mov    0x10(%ebp),%eax
  1052de:	3b 45 0c             	cmp    0xc(%ebp),%eax
  1052e1:	72 0a                	jb     1052ed <get_pgtable_items+0x18>
        return 0;
  1052e3:	b8 00 00 00 00       	mov    $0x0,%eax
  1052e8:	e9 9c 00 00 00       	jmp    105389 <get_pgtable_items+0xb4>
    }
    while (start < right && !(table[start] & PTE_P)) {
  1052ed:	eb 04                	jmp    1052f3 <get_pgtable_items+0x1e>
        start ++;
  1052ef:	83 45 10 01          	addl   $0x1,0x10(%ebp)
static int
get_pgtable_items(size_t left, size_t right, size_t start, uintptr_t *table, size_t *left_store, size_t *right_store) {
    if (start >= right) {
        return 0;
    }
    while (start < right && !(table[start] & PTE_P)) {
  1052f3:	8b 45 10             	mov    0x10(%ebp),%eax
  1052f6:	3b 45 0c             	cmp    0xc(%ebp),%eax
  1052f9:	73 18                	jae    105313 <get_pgtable_items+0x3e>
  1052fb:	8b 45 10             	mov    0x10(%ebp),%eax
  1052fe:	8d 14 85 00 00 00 00 	lea    0x0(,%eax,4),%edx
  105305:	8b 45 14             	mov    0x14(%ebp),%eax
  105308:	01 d0                	add    %edx,%eax
  10530a:	8b 00                	mov    (%eax),%eax
  10530c:	83 e0 01             	and    $0x1,%eax
  10530f:	85 c0                	test   %eax,%eax
  105311:	74 dc                	je     1052ef <get_pgtable_items+0x1a>
        start ++;
    }
    if (start < right) {
  105313:	8b 45 10             	mov    0x10(%ebp),%eax
  105316:	3b 45 0c             	cmp    0xc(%ebp),%eax
  105319:	73 69                	jae    105384 <get_pgtable_items+0xaf>
        if (left_store != NULL) {
  10531b:	83 7d 18 00          	cmpl   $0x0,0x18(%ebp)
  10531f:	74 08                	je     105329 <get_pgtable_items+0x54>
            *left_store = start;
  105321:	8b 45 18             	mov    0x18(%ebp),%eax
  105324:	8b 55 10             	mov    0x10(%ebp),%edx
  105327:	89 10                	mov    %edx,(%eax)
        }
        int perm = (table[start ++] & PTE_USER);
  105329:	8b 45 10             	mov    0x10(%ebp),%eax
  10532c:	8d 50 01             	lea    0x1(%eax),%edx
  10532f:	89 55 10             	mov    %edx,0x10(%ebp)
  105332:	8d 14 85 00 00 00 00 	lea    0x0(,%eax,4),%edx
  105339:	8b 45 14             	mov    0x14(%ebp),%eax
  10533c:	01 d0                	add    %edx,%eax
  10533e:	8b 00                	mov    (%eax),%eax
  105340:	83 e0 07             	and    $0x7,%eax
  105343:	89 45 fc             	mov    %eax,-0x4(%ebp)
        while (start < right && (table[start] & PTE_USER) == perm) {
  105346:	eb 04                	jmp    10534c <get_pgtable_items+0x77>
            start ++;
  105348:	83 45 10 01          	addl   $0x1,0x10(%ebp)
    if (start < right) {
        if (left_store != NULL) {
            *left_store = start;
        }
        int perm = (table[start ++] & PTE_USER);
        while (start < right && (table[start] & PTE_USER) == perm) {
  10534c:	8b 45 10             	mov    0x10(%ebp),%eax
  10534f:	3b 45 0c             	cmp    0xc(%ebp),%eax
  105352:	73 1d                	jae    105371 <get_pgtable_items+0x9c>
  105354:	8b 45 10             	mov    0x10(%ebp),%eax
  105357:	8d 14 85 00 00 00 00 	lea    0x0(,%eax,4),%edx
  10535e:	8b 45 14             	mov    0x14(%ebp),%eax
  105361:	01 d0                	add    %edx,%eax
  105363:	8b 00                	mov    (%eax),%eax
  105365:	83 e0 07             	and    $0x7,%eax
  105368:	89 c2                	mov    %eax,%edx
  10536a:	8b 45 fc             	mov    -0x4(%ebp),%eax
  10536d:	39 c2                	cmp    %eax,%edx
  10536f:	74 d7                	je     105348 <get_pgtable_items+0x73>
            start ++;
        }
        if (right_store != NULL) {
  105371:	83 7d 1c 00          	cmpl   $0x0,0x1c(%ebp)
  105375:	74 08                	je     10537f <get_pgtable_items+0xaa>
            *right_store = start;
  105377:	8b 45 1c             	mov    0x1c(%ebp),%eax
  10537a:	8b 55 10             	mov    0x10(%ebp),%edx
  10537d:	89 10                	mov    %edx,(%eax)
        }
        return perm;
  10537f:	8b 45 fc             	mov    -0x4(%ebp),%eax
  105382:	eb 05                	jmp    105389 <get_pgtable_items+0xb4>
    }
    return 0;
  105384:	b8 00 00 00 00       	mov    $0x0,%eax
}
  105389:	c9                   	leave  
  10538a:	c3                   	ret    

0010538b <print_pgdir>:

//print_pgdir - print the PDT&PT
void
print_pgdir(void) {
  10538b:	55                   	push   %ebp
  10538c:	89 e5                	mov    %esp,%ebp
  10538e:	57                   	push   %edi
  10538f:	56                   	push   %esi
  105390:	53                   	push   %ebx
  105391:	83 ec 4c             	sub    $0x4c,%esp
    cprintf("-------------------- BEGIN --------------------\n");
  105394:	c7 04 24 84 70 10 00 	movl   $0x107084,(%esp)
  10539b:	e8 9c af ff ff       	call   10033c <cprintf>
    size_t left, right = 0, perm;
  1053a0:	c7 45 dc 00 00 00 00 	movl   $0x0,-0x24(%ebp)
    while ((perm = get_pgtable_items(0, NPDEENTRY, right, vpd, &left, &right)) != 0) {
  1053a7:	e9 fa 00 00 00       	jmp    1054a6 <print_pgdir+0x11b>
        cprintf("PDE(%03x) %08x-%08x %08x %s\n", right - left,
  1053ac:	8b 45 e4             	mov    -0x1c(%ebp),%eax
  1053af:	89 04 24             	mov    %eax,(%esp)
  1053b2:	e8 d0 fe ff ff       	call   105287 <perm2str>
                left * PTSIZE, right * PTSIZE, (right - left) * PTSIZE, perm2str(perm));
  1053b7:	8b 4d dc             	mov    -0x24(%ebp),%ecx
  1053ba:	8b 55 e0             	mov    -0x20(%ebp),%edx
  1053bd:	29 d1                	sub    %edx,%ecx
  1053bf:	89 ca                	mov    %ecx,%edx
void
print_pgdir(void) {
    cprintf("-------------------- BEGIN --------------------\n");
    size_t left, right = 0, perm;
    while ((perm = get_pgtable_items(0, NPDEENTRY, right, vpd, &left, &right)) != 0) {
        cprintf("PDE(%03x) %08x-%08x %08x %s\n", right - left,
  1053c1:	89 d6                	mov    %edx,%esi
  1053c3:	c1 e6 16             	shl    $0x16,%esi
  1053c6:	8b 55 dc             	mov    -0x24(%ebp),%edx
  1053c9:	89 d3                	mov    %edx,%ebx
  1053cb:	c1 e3 16             	shl    $0x16,%ebx
  1053ce:	8b 55 e0             	mov    -0x20(%ebp),%edx
  1053d1:	89 d1                	mov    %edx,%ecx
  1053d3:	c1 e1 16             	shl    $0x16,%ecx
  1053d6:	8b 7d dc             	mov    -0x24(%ebp),%edi
  1053d9:	8b 55 e0             	mov    -0x20(%ebp),%edx
  1053dc:	29 d7                	sub    %edx,%edi
  1053de:	89 fa                	mov    %edi,%edx
  1053e0:	89 44 24 14          	mov    %eax,0x14(%esp)
  1053e4:	89 74 24 10          	mov    %esi,0x10(%esp)
  1053e8:	89 5c 24 0c          	mov    %ebx,0xc(%esp)
  1053ec:	89 4c 24 08          	mov    %ecx,0x8(%esp)
  1053f0:	89 54 24 04          	mov    %edx,0x4(%esp)
  1053f4:	c7 04 24 b5 70 10 00 	movl   $0x1070b5,(%esp)
  1053fb:	e8 3c af ff ff       	call   10033c <cprintf>
                left * PTSIZE, right * PTSIZE, (right - left) * PTSIZE, perm2str(perm));
        size_t l, r = left * NPTEENTRY;
  105400:	8b 45 e0             	mov    -0x20(%ebp),%eax
  105403:	c1 e0 0a             	shl    $0xa,%eax
  105406:	89 45 d4             	mov    %eax,-0x2c(%ebp)
        while ((perm = get_pgtable_items(left * NPTEENTRY, right * NPTEENTRY, r, vpt, &l, &r)) != 0) {
  105409:	eb 54                	jmp    10545f <print_pgdir+0xd4>
            cprintf("  |-- PTE(%05x) %08x-%08x %08x %s\n", r - l,
  10540b:	8b 45 e4             	mov    -0x1c(%ebp),%eax
  10540e:	89 04 24             	mov    %eax,(%esp)
  105411:	e8 71 fe ff ff       	call   105287 <perm2str>
                    l * PGSIZE, r * PGSIZE, (r - l) * PGSIZE, perm2str(perm));
  105416:	8b 4d d4             	mov    -0x2c(%ebp),%ecx
  105419:	8b 55 d8             	mov    -0x28(%ebp),%edx
  10541c:	29 d1                	sub    %edx,%ecx
  10541e:	89 ca                	mov    %ecx,%edx
    while ((perm = get_pgtable_items(0, NPDEENTRY, right, vpd, &left, &right)) != 0) {
        cprintf("PDE(%03x) %08x-%08x %08x %s\n", right - left,
                left * PTSIZE, right * PTSIZE, (right - left) * PTSIZE, perm2str(perm));
        size_t l, r = left * NPTEENTRY;
        while ((perm = get_pgtable_items(left * NPTEENTRY, right * NPTEENTRY, r, vpt, &l, &r)) != 0) {
            cprintf("  |-- PTE(%05x) %08x-%08x %08x %s\n", r - l,
  105420:	89 d6                	mov    %edx,%esi
  105422:	c1 e6 0c             	shl    $0xc,%esi
  105425:	8b 55 d4             	mov    -0x2c(%ebp),%edx
  105428:	89 d3                	mov    %edx,%ebx
  10542a:	c1 e3 0c             	shl    $0xc,%ebx
  10542d:	8b 55 d8             	mov    -0x28(%ebp),%edx
  105430:	c1 e2 0c             	shl    $0xc,%edx
  105433:	89 d1                	mov    %edx,%ecx
  105435:	8b 7d d4             	mov    -0x2c(%ebp),%edi
  105438:	8b 55 d8             	mov    -0x28(%ebp),%edx
  10543b:	29 d7                	sub    %edx,%edi
  10543d:	89 fa                	mov    %edi,%edx
  10543f:	89 44 24 14          	mov    %eax,0x14(%esp)
  105443:	89 74 24 10          	mov    %esi,0x10(%esp)
  105447:	89 5c 24 0c          	mov    %ebx,0xc(%esp)
  10544b:	89 4c 24 08          	mov    %ecx,0x8(%esp)
  10544f:	89 54 24 04          	mov    %edx,0x4(%esp)
  105453:	c7 04 24 d4 70 10 00 	movl   $0x1070d4,(%esp)
  10545a:	e8 dd ae ff ff       	call   10033c <cprintf>
    size_t left, right = 0, perm;
    while ((perm = get_pgtable_items(0, NPDEENTRY, right, vpd, &left, &right)) != 0) {
        cprintf("PDE(%03x) %08x-%08x %08x %s\n", right - left,
                left * PTSIZE, right * PTSIZE, (right - left) * PTSIZE, perm2str(perm));
        size_t l, r = left * NPTEENTRY;
        while ((perm = get_pgtable_items(left * NPTEENTRY, right * NPTEENTRY, r, vpt, &l, &r)) != 0) {
  10545f:	ba 00 00 c0 fa       	mov    $0xfac00000,%edx
  105464:	8b 45 d4             	mov    -0x2c(%ebp),%eax
  105467:	8b 4d dc             	mov    -0x24(%ebp),%ecx
  10546a:	89 ce                	mov    %ecx,%esi
  10546c:	c1 e6 0a             	shl    $0xa,%esi
  10546f:	8b 4d e0             	mov    -0x20(%ebp),%ecx
  105472:	89 cb                	mov    %ecx,%ebx
  105474:	c1 e3 0a             	shl    $0xa,%ebx
  105477:	8d 4d d4             	lea    -0x2c(%ebp),%ecx
  10547a:	89 4c 24 14          	mov    %ecx,0x14(%esp)
  10547e:	8d 4d d8             	lea    -0x28(%ebp),%ecx
  105481:	89 4c 24 10          	mov    %ecx,0x10(%esp)
  105485:	89 54 24 0c          	mov    %edx,0xc(%esp)
  105489:	89 44 24 08          	mov    %eax,0x8(%esp)
  10548d:	89 74 24 04          	mov    %esi,0x4(%esp)
  105491:	89 1c 24             	mov    %ebx,(%esp)
  105494:	e8 3c fe ff ff       	call   1052d5 <get_pgtable_items>
  105499:	89 45 e4             	mov    %eax,-0x1c(%ebp)
  10549c:	83 7d e4 00          	cmpl   $0x0,-0x1c(%ebp)
  1054a0:	0f 85 65 ff ff ff    	jne    10540b <print_pgdir+0x80>
//print_pgdir - print the PDT&PT
void
print_pgdir(void) {
    cprintf("-------------------- BEGIN --------------------\n");
    size_t left, right = 0, perm;
    while ((perm = get_pgtable_items(0, NPDEENTRY, right, vpd, &left, &right)) != 0) {
  1054a6:	ba 00 b0 fe fa       	mov    $0xfafeb000,%edx
  1054ab:	8b 45 dc             	mov    -0x24(%ebp),%eax
  1054ae:	8d 4d dc             	lea    -0x24(%ebp),%ecx
  1054b1:	89 4c 24 14          	mov    %ecx,0x14(%esp)
  1054b5:	8d 4d e0             	lea    -0x20(%ebp),%ecx
  1054b8:	89 4c 24 10          	mov    %ecx,0x10(%esp)
  1054bc:	89 54 24 0c          	mov    %edx,0xc(%esp)
  1054c0:	89 44 24 08          	mov    %eax,0x8(%esp)
  1054c4:	c7 44 24 04 00 04 00 	movl   $0x400,0x4(%esp)
  1054cb:	00 
  1054cc:	c7 04 24 00 00 00 00 	movl   $0x0,(%esp)
  1054d3:	e8 fd fd ff ff       	call   1052d5 <get_pgtable_items>
  1054d8:	89 45 e4             	mov    %eax,-0x1c(%ebp)
  1054db:	83 7d e4 00          	cmpl   $0x0,-0x1c(%ebp)
  1054df:	0f 85 c7 fe ff ff    	jne    1053ac <print_pgdir+0x21>
        while ((perm = get_pgtable_items(left * NPTEENTRY, right * NPTEENTRY, r, vpt, &l, &r)) != 0) {
            cprintf("  |-- PTE(%05x) %08x-%08x %08x %s\n", r - l,
                    l * PGSIZE, r * PGSIZE, (r - l) * PGSIZE, perm2str(perm));
        }
    }
    cprintf("--------------------- END ---------------------\n");
  1054e5:	c7 04 24 f8 70 10 00 	movl   $0x1070f8,(%esp)
  1054ec:	e8 4b ae ff ff       	call   10033c <cprintf>
}
  1054f1:	83 c4 4c             	add    $0x4c,%esp
  1054f4:	5b                   	pop    %ebx
  1054f5:	5e                   	pop    %esi
  1054f6:	5f                   	pop    %edi
  1054f7:	5d                   	pop    %ebp
  1054f8:	c3                   	ret    

001054f9 <printnum>:
 * @width:      maximum number of digits, if the actual width is less than @width, use @padc instead
 * @padc:       character that padded on the left if the actual width is less than @width
 * */
static void
printnum(void (*putch)(int, void*), void *putdat,
        unsigned long long num, unsigned base, int width, int padc) {
  1054f9:	55                   	push   %ebp
  1054fa:	89 e5                	mov    %esp,%ebp
  1054fc:	83 ec 58             	sub    $0x58,%esp
  1054ff:	8b 45 10             	mov    0x10(%ebp),%eax
  105502:	89 45 d0             	mov    %eax,-0x30(%ebp)
  105505:	8b 45 14             	mov    0x14(%ebp),%eax
  105508:	89 45 d4             	mov    %eax,-0x2c(%ebp)
    unsigned long long result = num;
  10550b:	8b 45 d0             	mov    -0x30(%ebp),%eax
  10550e:	8b 55 d4             	mov    -0x2c(%ebp),%edx
  105511:	89 45 e8             	mov    %eax,-0x18(%ebp)
  105514:	89 55 ec             	mov    %edx,-0x14(%ebp)
    unsigned mod = do_div(result, base);
  105517:	8b 45 18             	mov    0x18(%ebp),%eax
  10551a:	89 45 e4             	mov    %eax,-0x1c(%ebp)
  10551d:	8b 45 e8             	mov    -0x18(%ebp),%eax
  105520:	8b 55 ec             	mov    -0x14(%ebp),%edx
  105523:	89 45 e0             	mov    %eax,-0x20(%ebp)
  105526:	89 55 f0             	mov    %edx,-0x10(%ebp)
  105529:	8b 45 f0             	mov    -0x10(%ebp),%eax
  10552c:	89 45 f4             	mov    %eax,-0xc(%ebp)
  10552f:	83 7d f0 00          	cmpl   $0x0,-0x10(%ebp)
  105533:	74 1c                	je     105551 <printnum+0x58>
  105535:	8b 45 f0             	mov    -0x10(%ebp),%eax
  105538:	ba 00 00 00 00       	mov    $0x0,%edx
  10553d:	f7 75 e4             	divl   -0x1c(%ebp)
  105540:	89 55 f4             	mov    %edx,-0xc(%ebp)
  105543:	8b 45 f0             	mov    -0x10(%ebp),%eax
  105546:	ba 00 00 00 00       	mov    $0x0,%edx
  10554b:	f7 75 e4             	divl   -0x1c(%ebp)
  10554e:	89 45 f0             	mov    %eax,-0x10(%ebp)
  105551:	8b 45 e0             	mov    -0x20(%ebp),%eax
  105554:	8b 55 f4             	mov    -0xc(%ebp),%edx
  105557:	f7 75 e4             	divl   -0x1c(%ebp)
  10555a:	89 45 e0             	mov    %eax,-0x20(%ebp)
  10555d:	89 55 dc             	mov    %edx,-0x24(%ebp)
  105560:	8b 45 e0             	mov    -0x20(%ebp),%eax
  105563:	8b 55 f0             	mov    -0x10(%ebp),%edx
  105566:	89 45 e8             	mov    %eax,-0x18(%ebp)
  105569:	89 55 ec             	mov    %edx,-0x14(%ebp)
  10556c:	8b 45 dc             	mov    -0x24(%ebp),%eax
  10556f:	89 45 d8             	mov    %eax,-0x28(%ebp)

    // first recursively print all preceding (more significant) digits
    if (num >= base) {
  105572:	8b 45 18             	mov    0x18(%ebp),%eax
  105575:	ba 00 00 00 00       	mov    $0x0,%edx
  10557a:	3b 55 d4             	cmp    -0x2c(%ebp),%edx
  10557d:	77 56                	ja     1055d5 <printnum+0xdc>
  10557f:	3b 55 d4             	cmp    -0x2c(%ebp),%edx
  105582:	72 05                	jb     105589 <printnum+0x90>
  105584:	3b 45 d0             	cmp    -0x30(%ebp),%eax
  105587:	77 4c                	ja     1055d5 <printnum+0xdc>
        printnum(putch, putdat, result, base, width - 1, padc);
  105589:	8b 45 1c             	mov    0x1c(%ebp),%eax
  10558c:	8d 50 ff             	lea    -0x1(%eax),%edx
  10558f:	8b 45 20             	mov    0x20(%ebp),%eax
  105592:	89 44 24 18          	mov    %eax,0x18(%esp)
  105596:	89 54 24 14          	mov    %edx,0x14(%esp)
  10559a:	8b 45 18             	mov    0x18(%ebp),%eax
  10559d:	89 44 24 10          	mov    %eax,0x10(%esp)
  1055a1:	8b 45 e8             	mov    -0x18(%ebp),%eax
  1055a4:	8b 55 ec             	mov    -0x14(%ebp),%edx
  1055a7:	89 44 24 08          	mov    %eax,0x8(%esp)
  1055ab:	89 54 24 0c          	mov    %edx,0xc(%esp)
  1055af:	8b 45 0c             	mov    0xc(%ebp),%eax
  1055b2:	89 44 24 04          	mov    %eax,0x4(%esp)
  1055b6:	8b 45 08             	mov    0x8(%ebp),%eax
  1055b9:	89 04 24             	mov    %eax,(%esp)
  1055bc:	e8 38 ff ff ff       	call   1054f9 <printnum>
  1055c1:	eb 1c                	jmp    1055df <printnum+0xe6>
    } else {
        // print any needed pad characters before first digit
        while (-- width > 0)
            putch(padc, putdat);
  1055c3:	8b 45 0c             	mov    0xc(%ebp),%eax
  1055c6:	89 44 24 04          	mov    %eax,0x4(%esp)
  1055ca:	8b 45 20             	mov    0x20(%ebp),%eax
  1055cd:	89 04 24             	mov    %eax,(%esp)
  1055d0:	8b 45 08             	mov    0x8(%ebp),%eax
  1055d3:	ff d0                	call   *%eax
    // first recursively print all preceding (more significant) digits
    if (num >= base) {
        printnum(putch, putdat, result, base, width - 1, padc);
    } else {
        // print any needed pad characters before first digit
        while (-- width > 0)
  1055d5:	83 6d 1c 01          	subl   $0x1,0x1c(%ebp)
  1055d9:	83 7d 1c 00          	cmpl   $0x0,0x1c(%ebp)
  1055dd:	7f e4                	jg     1055c3 <printnum+0xca>
            putch(padc, putdat);
    }
    // then print this (the least significant) digit
    putch("0123456789abcdef"[mod], putdat);
  1055df:	8b 45 d8             	mov    -0x28(%ebp),%eax
  1055e2:	05 ac 71 10 00       	add    $0x1071ac,%eax
  1055e7:	0f b6 00             	movzbl (%eax),%eax
  1055ea:	0f be c0             	movsbl %al,%eax
  1055ed:	8b 55 0c             	mov    0xc(%ebp),%edx
  1055f0:	89 54 24 04          	mov    %edx,0x4(%esp)
  1055f4:	89 04 24             	mov    %eax,(%esp)
  1055f7:	8b 45 08             	mov    0x8(%ebp),%eax
  1055fa:	ff d0                	call   *%eax
}
  1055fc:	c9                   	leave  
  1055fd:	c3                   	ret    

001055fe <getuint>:
 * getuint - get an unsigned int of various possible sizes from a varargs list
 * @ap:         a varargs list pointer
 * @lflag:      determines the size of the vararg that @ap points to
 * */
static unsigned long long
getuint(va_list *ap, int lflag) {
  1055fe:	55                   	push   %ebp
  1055ff:	89 e5                	mov    %esp,%ebp
    if (lflag >= 2) {
  105601:	83 7d 0c 01          	cmpl   $0x1,0xc(%ebp)
  105605:	7e 14                	jle    10561b <getuint+0x1d>
        return va_arg(*ap, unsigned long long);
  105607:	8b 45 08             	mov    0x8(%ebp),%eax
  10560a:	8b 00                	mov    (%eax),%eax
  10560c:	8d 48 08             	lea    0x8(%eax),%ecx
  10560f:	8b 55 08             	mov    0x8(%ebp),%edx
  105612:	89 0a                	mov    %ecx,(%edx)
  105614:	8b 50 04             	mov    0x4(%eax),%edx
  105617:	8b 00                	mov    (%eax),%eax
  105619:	eb 30                	jmp    10564b <getuint+0x4d>
    }
    else if (lflag) {
  10561b:	83 7d 0c 00          	cmpl   $0x0,0xc(%ebp)
  10561f:	74 16                	je     105637 <getuint+0x39>
        return va_arg(*ap, unsigned long);
  105621:	8b 45 08             	mov    0x8(%ebp),%eax
  105624:	8b 00                	mov    (%eax),%eax
  105626:	8d 48 04             	lea    0x4(%eax),%ecx
  105629:	8b 55 08             	mov    0x8(%ebp),%edx
  10562c:	89 0a                	mov    %ecx,(%edx)
  10562e:	8b 00                	mov    (%eax),%eax
  105630:	ba 00 00 00 00       	mov    $0x0,%edx
  105635:	eb 14                	jmp    10564b <getuint+0x4d>
    }
    else {
        return va_arg(*ap, unsigned int);
  105637:	8b 45 08             	mov    0x8(%ebp),%eax
  10563a:	8b 00                	mov    (%eax),%eax
  10563c:	8d 48 04             	lea    0x4(%eax),%ecx
  10563f:	8b 55 08             	mov    0x8(%ebp),%edx
  105642:	89 0a                	mov    %ecx,(%edx)
  105644:	8b 00                	mov    (%eax),%eax
  105646:	ba 00 00 00 00       	mov    $0x0,%edx
    }
}
  10564b:	5d                   	pop    %ebp
  10564c:	c3                   	ret    

0010564d <getint>:
 * getint - same as getuint but signed, we can't use getuint because of sign extension
 * @ap:         a varargs list pointer
 * @lflag:      determines the size of the vararg that @ap points to
 * */
static long long
getint(va_list *ap, int lflag) {
  10564d:	55                   	push   %ebp
  10564e:	89 e5                	mov    %esp,%ebp
    if (lflag >= 2) {
  105650:	83 7d 0c 01          	cmpl   $0x1,0xc(%ebp)
  105654:	7e 14                	jle    10566a <getint+0x1d>
        return va_arg(*ap, long long);
  105656:	8b 45 08             	mov    0x8(%ebp),%eax
  105659:	8b 00                	mov    (%eax),%eax
  10565b:	8d 48 08             	lea    0x8(%eax),%ecx
  10565e:	8b 55 08             	mov    0x8(%ebp),%edx
  105661:	89 0a                	mov    %ecx,(%edx)
  105663:	8b 50 04             	mov    0x4(%eax),%edx
  105666:	8b 00                	mov    (%eax),%eax
  105668:	eb 28                	jmp    105692 <getint+0x45>
    }
    else if (lflag) {
  10566a:	83 7d 0c 00          	cmpl   $0x0,0xc(%ebp)
  10566e:	74 12                	je     105682 <getint+0x35>
        return va_arg(*ap, long);
  105670:	8b 45 08             	mov    0x8(%ebp),%eax
  105673:	8b 00                	mov    (%eax),%eax
  105675:	8d 48 04             	lea    0x4(%eax),%ecx
  105678:	8b 55 08             	mov    0x8(%ebp),%edx
  10567b:	89 0a                	mov    %ecx,(%edx)
  10567d:	8b 00                	mov    (%eax),%eax
  10567f:	99                   	cltd   
  105680:	eb 10                	jmp    105692 <getint+0x45>
    }
    else {
        return va_arg(*ap, int);
  105682:	8b 45 08             	mov    0x8(%ebp),%eax
  105685:	8b 00                	mov    (%eax),%eax
  105687:	8d 48 04             	lea    0x4(%eax),%ecx
  10568a:	8b 55 08             	mov    0x8(%ebp),%edx
  10568d:	89 0a                	mov    %ecx,(%edx)
  10568f:	8b 00                	mov    (%eax),%eax
  105691:	99                   	cltd   
    }
}
  105692:	5d                   	pop    %ebp
  105693:	c3                   	ret    

00105694 <printfmt>:
 * @putch:      specified putch function, print a single character
 * @putdat:     used by @putch function
 * @fmt:        the format string to use
 * */
void
printfmt(void (*putch)(int, void*), void *putdat, const char *fmt, ...) {
  105694:	55                   	push   %ebp
  105695:	89 e5                	mov    %esp,%ebp
  105697:	83 ec 28             	sub    $0x28,%esp
    va_list ap;

    va_start(ap, fmt);
  10569a:	8d 45 14             	lea    0x14(%ebp),%eax
  10569d:	89 45 f4             	mov    %eax,-0xc(%ebp)
    vprintfmt(putch, putdat, fmt, ap);
  1056a0:	8b 45 f4             	mov    -0xc(%ebp),%eax
  1056a3:	89 44 24 0c          	mov    %eax,0xc(%esp)
  1056a7:	8b 45 10             	mov    0x10(%ebp),%eax
  1056aa:	89 44 24 08          	mov    %eax,0x8(%esp)
  1056ae:	8b 45 0c             	mov    0xc(%ebp),%eax
  1056b1:	89 44 24 04          	mov    %eax,0x4(%esp)
  1056b5:	8b 45 08             	mov    0x8(%ebp),%eax
  1056b8:	89 04 24             	mov    %eax,(%esp)
  1056bb:	e8 02 00 00 00       	call   1056c2 <vprintfmt>
    va_end(ap);
}
  1056c0:	c9                   	leave  
  1056c1:	c3                   	ret    

001056c2 <vprintfmt>:
 *
 * Call this function if you are already dealing with a va_list.
 * Or you probably want printfmt() instead.
 * */
void
vprintfmt(void (*putch)(int, void*), void *putdat, const char *fmt, va_list ap) {
  1056c2:	55                   	push   %ebp
  1056c3:	89 e5                	mov    %esp,%ebp
  1056c5:	56                   	push   %esi
  1056c6:	53                   	push   %ebx
  1056c7:	83 ec 40             	sub    $0x40,%esp
    register int ch, err;
    unsigned long long num;
    int base, width, precision, lflag, altflag;

    while (1) {
        while ((ch = *(unsigned char *)fmt ++) != '%') {
  1056ca:	eb 18                	jmp    1056e4 <vprintfmt+0x22>
            if (ch == '\0') {
  1056cc:	85 db                	test   %ebx,%ebx
  1056ce:	75 05                	jne    1056d5 <vprintfmt+0x13>
                return;
  1056d0:	e9 d1 03 00 00       	jmp    105aa6 <vprintfmt+0x3e4>
            }
            putch(ch, putdat);
  1056d5:	8b 45 0c             	mov    0xc(%ebp),%eax
  1056d8:	89 44 24 04          	mov    %eax,0x4(%esp)
  1056dc:	89 1c 24             	mov    %ebx,(%esp)
  1056df:	8b 45 08             	mov    0x8(%ebp),%eax
  1056e2:	ff d0                	call   *%eax
    register int ch, err;
    unsigned long long num;
    int base, width, precision, lflag, altflag;

    while (1) {
        while ((ch = *(unsigned char *)fmt ++) != '%') {
  1056e4:	8b 45 10             	mov    0x10(%ebp),%eax
  1056e7:	8d 50 01             	lea    0x1(%eax),%edx
  1056ea:	89 55 10             	mov    %edx,0x10(%ebp)
  1056ed:	0f b6 00             	movzbl (%eax),%eax
  1056f0:	0f b6 d8             	movzbl %al,%ebx
  1056f3:	83 fb 25             	cmp    $0x25,%ebx
  1056f6:	75 d4                	jne    1056cc <vprintfmt+0xa>
            }
            putch(ch, putdat);
        }

        // Process a %-escape sequence
        char padc = ' ';
  1056f8:	c6 45 db 20          	movb   $0x20,-0x25(%ebp)
        width = precision = -1;
  1056fc:	c7 45 e4 ff ff ff ff 	movl   $0xffffffff,-0x1c(%ebp)
  105703:	8b 45 e4             	mov    -0x1c(%ebp),%eax
  105706:	89 45 e8             	mov    %eax,-0x18(%ebp)
        lflag = altflag = 0;
  105709:	c7 45 dc 00 00 00 00 	movl   $0x0,-0x24(%ebp)
  105710:	8b 45 dc             	mov    -0x24(%ebp),%eax
  105713:	89 45 e0             	mov    %eax,-0x20(%ebp)

    reswitch:
        switch (ch = *(unsigned char *)fmt ++) {
  105716:	8b 45 10             	mov    0x10(%ebp),%eax
  105719:	8d 50 01             	lea    0x1(%eax),%edx
  10571c:	89 55 10             	mov    %edx,0x10(%ebp)
  10571f:	0f b6 00             	movzbl (%eax),%eax
  105722:	0f b6 d8             	movzbl %al,%ebx
  105725:	8d 43 dd             	lea    -0x23(%ebx),%eax
  105728:	83 f8 55             	cmp    $0x55,%eax
  10572b:	0f 87 44 03 00 00    	ja     105a75 <vprintfmt+0x3b3>
  105731:	8b 04 85 d0 71 10 00 	mov    0x1071d0(,%eax,4),%eax
  105738:	ff e0                	jmp    *%eax

        // flag to pad on the right
        case '-':
            padc = '-';
  10573a:	c6 45 db 2d          	movb   $0x2d,-0x25(%ebp)
            goto reswitch;
  10573e:	eb d6                	jmp    105716 <vprintfmt+0x54>

        // flag to pad with 0's instead of spaces
        case '0':
            padc = '0';
  105740:	c6 45 db 30          	movb   $0x30,-0x25(%ebp)
            goto reswitch;
  105744:	eb d0                	jmp    105716 <vprintfmt+0x54>

        // width field
        case '1' ... '9':
            for (precision = 0; ; ++ fmt) {
  105746:	c7 45 e4 00 00 00 00 	movl   $0x0,-0x1c(%ebp)
                precision = precision * 10 + ch - '0';
  10574d:	8b 55 e4             	mov    -0x1c(%ebp),%edx
  105750:	89 d0                	mov    %edx,%eax
  105752:	c1 e0 02             	shl    $0x2,%eax
  105755:	01 d0                	add    %edx,%eax
  105757:	01 c0                	add    %eax,%eax
  105759:	01 d8                	add    %ebx,%eax
  10575b:	83 e8 30             	sub    $0x30,%eax
  10575e:	89 45 e4             	mov    %eax,-0x1c(%ebp)
                ch = *fmt;
  105761:	8b 45 10             	mov    0x10(%ebp),%eax
  105764:	0f b6 00             	movzbl (%eax),%eax
  105767:	0f be d8             	movsbl %al,%ebx
                if (ch < '0' || ch > '9') {
  10576a:	83 fb 2f             	cmp    $0x2f,%ebx
  10576d:	7e 0b                	jle    10577a <vprintfmt+0xb8>
  10576f:	83 fb 39             	cmp    $0x39,%ebx
  105772:	7f 06                	jg     10577a <vprintfmt+0xb8>
            padc = '0';
            goto reswitch;

        // width field
        case '1' ... '9':
            for (precision = 0; ; ++ fmt) {
  105774:	83 45 10 01          	addl   $0x1,0x10(%ebp)
                precision = precision * 10 + ch - '0';
                ch = *fmt;
                if (ch < '0' || ch > '9') {
                    break;
                }
            }
  105778:	eb d3                	jmp    10574d <vprintfmt+0x8b>
            goto process_precision;
  10577a:	eb 33                	jmp    1057af <vprintfmt+0xed>

        case '*':
            precision = va_arg(ap, int);
  10577c:	8b 45 14             	mov    0x14(%ebp),%eax
  10577f:	8d 50 04             	lea    0x4(%eax),%edx
  105782:	89 55 14             	mov    %edx,0x14(%ebp)
  105785:	8b 00                	mov    (%eax),%eax
  105787:	89 45 e4             	mov    %eax,-0x1c(%ebp)
            goto process_precision;
  10578a:	eb 23                	jmp    1057af <vprintfmt+0xed>

        case '.':
            if (width < 0)
  10578c:	83 7d e8 00          	cmpl   $0x0,-0x18(%ebp)
  105790:	79 0c                	jns    10579e <vprintfmt+0xdc>
                width = 0;
  105792:	c7 45 e8 00 00 00 00 	movl   $0x0,-0x18(%ebp)
            goto reswitch;
  105799:	e9 78 ff ff ff       	jmp    105716 <vprintfmt+0x54>
  10579e:	e9 73 ff ff ff       	jmp    105716 <vprintfmt+0x54>

        case '#':
            altflag = 1;
  1057a3:	c7 45 dc 01 00 00 00 	movl   $0x1,-0x24(%ebp)
            goto reswitch;
  1057aa:	e9 67 ff ff ff       	jmp    105716 <vprintfmt+0x54>

        process_precision:
            if (width < 0)
  1057af:	83 7d e8 00          	cmpl   $0x0,-0x18(%ebp)
  1057b3:	79 12                	jns    1057c7 <vprintfmt+0x105>
                width = precision, precision = -1;
  1057b5:	8b 45 e4             	mov    -0x1c(%ebp),%eax
  1057b8:	89 45 e8             	mov    %eax,-0x18(%ebp)
  1057bb:	c7 45 e4 ff ff ff ff 	movl   $0xffffffff,-0x1c(%ebp)
            goto reswitch;
  1057c2:	e9 4f ff ff ff       	jmp    105716 <vprintfmt+0x54>
  1057c7:	e9 4a ff ff ff       	jmp    105716 <vprintfmt+0x54>

        // long flag (doubled for long long)
        case 'l':
            lflag ++;
  1057cc:	83 45 e0 01          	addl   $0x1,-0x20(%ebp)
            goto reswitch;
  1057d0:	e9 41 ff ff ff       	jmp    105716 <vprintfmt+0x54>

        // character
        case 'c':
            putch(va_arg(ap, int), putdat);
  1057d5:	8b 45 14             	mov    0x14(%ebp),%eax
  1057d8:	8d 50 04             	lea    0x4(%eax),%edx
  1057db:	89 55 14             	mov    %edx,0x14(%ebp)
  1057de:	8b 00                	mov    (%eax),%eax
  1057e0:	8b 55 0c             	mov    0xc(%ebp),%edx
  1057e3:	89 54 24 04          	mov    %edx,0x4(%esp)
  1057e7:	89 04 24             	mov    %eax,(%esp)
  1057ea:	8b 45 08             	mov    0x8(%ebp),%eax
  1057ed:	ff d0                	call   *%eax
            break;
  1057ef:	e9 ac 02 00 00       	jmp    105aa0 <vprintfmt+0x3de>

        // error message
        case 'e':
            err = va_arg(ap, int);
  1057f4:	8b 45 14             	mov    0x14(%ebp),%eax
  1057f7:	8d 50 04             	lea    0x4(%eax),%edx
  1057fa:	89 55 14             	mov    %edx,0x14(%ebp)
  1057fd:	8b 18                	mov    (%eax),%ebx
            if (err < 0) {
  1057ff:	85 db                	test   %ebx,%ebx
  105801:	79 02                	jns    105805 <vprintfmt+0x143>
                err = -err;
  105803:	f7 db                	neg    %ebx
            }
            if (err > MAXERROR || (p = error_string[err]) == NULL) {
  105805:	83 fb 06             	cmp    $0x6,%ebx
  105808:	7f 0b                	jg     105815 <vprintfmt+0x153>
  10580a:	8b 34 9d 90 71 10 00 	mov    0x107190(,%ebx,4),%esi
  105811:	85 f6                	test   %esi,%esi
  105813:	75 23                	jne    105838 <vprintfmt+0x176>
                printfmt(putch, putdat, "error %d", err);
  105815:	89 5c 24 0c          	mov    %ebx,0xc(%esp)
  105819:	c7 44 24 08 bd 71 10 	movl   $0x1071bd,0x8(%esp)
  105820:	00 
  105821:	8b 45 0c             	mov    0xc(%ebp),%eax
  105824:	89 44 24 04          	mov    %eax,0x4(%esp)
  105828:	8b 45 08             	mov    0x8(%ebp),%eax
  10582b:	89 04 24             	mov    %eax,(%esp)
  10582e:	e8 61 fe ff ff       	call   105694 <printfmt>
            }
            else {
                printfmt(putch, putdat, "%s", p);
            }
            break;
  105833:	e9 68 02 00 00       	jmp    105aa0 <vprintfmt+0x3de>
            }
            if (err > MAXERROR || (p = error_string[err]) == NULL) {
                printfmt(putch, putdat, "error %d", err);
            }
            else {
                printfmt(putch, putdat, "%s", p);
  105838:	89 74 24 0c          	mov    %esi,0xc(%esp)
  10583c:	c7 44 24 08 c6 71 10 	movl   $0x1071c6,0x8(%esp)
  105843:	00 
  105844:	8b 45 0c             	mov    0xc(%ebp),%eax
  105847:	89 44 24 04          	mov    %eax,0x4(%esp)
  10584b:	8b 45 08             	mov    0x8(%ebp),%eax
  10584e:	89 04 24             	mov    %eax,(%esp)
  105851:	e8 3e fe ff ff       	call   105694 <printfmt>
            }
            break;
  105856:	e9 45 02 00 00       	jmp    105aa0 <vprintfmt+0x3de>

        // string
        case 's':
            if ((p = va_arg(ap, char *)) == NULL) {
  10585b:	8b 45 14             	mov    0x14(%ebp),%eax
  10585e:	8d 50 04             	lea    0x4(%eax),%edx
  105861:	89 55 14             	mov    %edx,0x14(%ebp)
  105864:	8b 30                	mov    (%eax),%esi
  105866:	85 f6                	test   %esi,%esi
  105868:	75 05                	jne    10586f <vprintfmt+0x1ad>
                p = "(null)";
  10586a:	be c9 71 10 00       	mov    $0x1071c9,%esi
            }
            if (width > 0 && padc != '-') {
  10586f:	83 7d e8 00          	cmpl   $0x0,-0x18(%ebp)
  105873:	7e 3e                	jle    1058b3 <vprintfmt+0x1f1>
  105875:	80 7d db 2d          	cmpb   $0x2d,-0x25(%ebp)
  105879:	74 38                	je     1058b3 <vprintfmt+0x1f1>
                for (width -= strnlen(p, precision); width > 0; width --) {
  10587b:	8b 5d e8             	mov    -0x18(%ebp),%ebx
  10587e:	8b 45 e4             	mov    -0x1c(%ebp),%eax
  105881:	89 44 24 04          	mov    %eax,0x4(%esp)
  105885:	89 34 24             	mov    %esi,(%esp)
  105888:	e8 15 03 00 00       	call   105ba2 <strnlen>
  10588d:	29 c3                	sub    %eax,%ebx
  10588f:	89 d8                	mov    %ebx,%eax
  105891:	89 45 e8             	mov    %eax,-0x18(%ebp)
  105894:	eb 17                	jmp    1058ad <vprintfmt+0x1eb>
                    putch(padc, putdat);
  105896:	0f be 45 db          	movsbl -0x25(%ebp),%eax
  10589a:	8b 55 0c             	mov    0xc(%ebp),%edx
  10589d:	89 54 24 04          	mov    %edx,0x4(%esp)
  1058a1:	89 04 24             	mov    %eax,(%esp)
  1058a4:	8b 45 08             	mov    0x8(%ebp),%eax
  1058a7:	ff d0                	call   *%eax
        case 's':
            if ((p = va_arg(ap, char *)) == NULL) {
                p = "(null)";
            }
            if (width > 0 && padc != '-') {
                for (width -= strnlen(p, precision); width > 0; width --) {
  1058a9:	83 6d e8 01          	subl   $0x1,-0x18(%ebp)
  1058ad:	83 7d e8 00          	cmpl   $0x0,-0x18(%ebp)
  1058b1:	7f e3                	jg     105896 <vprintfmt+0x1d4>
                    putch(padc, putdat);
                }
            }
            for (; (ch = *p ++) != '\0' && (precision < 0 || -- precision >= 0); width --) {
  1058b3:	eb 38                	jmp    1058ed <vprintfmt+0x22b>
                if (altflag && (ch < ' ' || ch > '~')) {
  1058b5:	83 7d dc 00          	cmpl   $0x0,-0x24(%ebp)
  1058b9:	74 1f                	je     1058da <vprintfmt+0x218>
  1058bb:	83 fb 1f             	cmp    $0x1f,%ebx
  1058be:	7e 05                	jle    1058c5 <vprintfmt+0x203>
  1058c0:	83 fb 7e             	cmp    $0x7e,%ebx
  1058c3:	7e 15                	jle    1058da <vprintfmt+0x218>
                    putch('?', putdat);
  1058c5:	8b 45 0c             	mov    0xc(%ebp),%eax
  1058c8:	89 44 24 04          	mov    %eax,0x4(%esp)
  1058cc:	c7 04 24 3f 00 00 00 	movl   $0x3f,(%esp)
  1058d3:	8b 45 08             	mov    0x8(%ebp),%eax
  1058d6:	ff d0                	call   *%eax
  1058d8:	eb 0f                	jmp    1058e9 <vprintfmt+0x227>
                }
                else {
                    putch(ch, putdat);
  1058da:	8b 45 0c             	mov    0xc(%ebp),%eax
  1058dd:	89 44 24 04          	mov    %eax,0x4(%esp)
  1058e1:	89 1c 24             	mov    %ebx,(%esp)
  1058e4:	8b 45 08             	mov    0x8(%ebp),%eax
  1058e7:	ff d0                	call   *%eax
            if (width > 0 && padc != '-') {
                for (width -= strnlen(p, precision); width > 0; width --) {
                    putch(padc, putdat);
                }
            }
            for (; (ch = *p ++) != '\0' && (precision < 0 || -- precision >= 0); width --) {
  1058e9:	83 6d e8 01          	subl   $0x1,-0x18(%ebp)
  1058ed:	89 f0                	mov    %esi,%eax
  1058ef:	8d 70 01             	lea    0x1(%eax),%esi
  1058f2:	0f b6 00             	movzbl (%eax),%eax
  1058f5:	0f be d8             	movsbl %al,%ebx
  1058f8:	85 db                	test   %ebx,%ebx
  1058fa:	74 10                	je     10590c <vprintfmt+0x24a>
  1058fc:	83 7d e4 00          	cmpl   $0x0,-0x1c(%ebp)
  105900:	78 b3                	js     1058b5 <vprintfmt+0x1f3>
  105902:	83 6d e4 01          	subl   $0x1,-0x1c(%ebp)
  105906:	83 7d e4 00          	cmpl   $0x0,-0x1c(%ebp)
  10590a:	79 a9                	jns    1058b5 <vprintfmt+0x1f3>
                }
                else {
                    putch(ch, putdat);
                }
            }
            for (; width > 0; width --) {
  10590c:	eb 17                	jmp    105925 <vprintfmt+0x263>
                putch(' ', putdat);
  10590e:	8b 45 0c             	mov    0xc(%ebp),%eax
  105911:	89 44 24 04          	mov    %eax,0x4(%esp)
  105915:	c7 04 24 20 00 00 00 	movl   $0x20,(%esp)
  10591c:	8b 45 08             	mov    0x8(%ebp),%eax
  10591f:	ff d0                	call   *%eax
                }
                else {
                    putch(ch, putdat);
                }
            }
            for (; width > 0; width --) {
  105921:	83 6d e8 01          	subl   $0x1,-0x18(%ebp)
  105925:	83 7d e8 00          	cmpl   $0x0,-0x18(%ebp)
  105929:	7f e3                	jg     10590e <vprintfmt+0x24c>
                putch(' ', putdat);
            }
            break;
  10592b:	e9 70 01 00 00       	jmp    105aa0 <vprintfmt+0x3de>

        // (signed) decimal
        case 'd':
            num = getint(&ap, lflag);
  105930:	8b 45 e0             	mov    -0x20(%ebp),%eax
  105933:	89 44 24 04          	mov    %eax,0x4(%esp)
  105937:	8d 45 14             	lea    0x14(%ebp),%eax
  10593a:	89 04 24             	mov    %eax,(%esp)
  10593d:	e8 0b fd ff ff       	call   10564d <getint>
  105942:	89 45 f0             	mov    %eax,-0x10(%ebp)
  105945:	89 55 f4             	mov    %edx,-0xc(%ebp)
            if ((long long)num < 0) {
  105948:	8b 45 f0             	mov    -0x10(%ebp),%eax
  10594b:	8b 55 f4             	mov    -0xc(%ebp),%edx
  10594e:	85 d2                	test   %edx,%edx
  105950:	79 26                	jns    105978 <vprintfmt+0x2b6>
                putch('-', putdat);
  105952:	8b 45 0c             	mov    0xc(%ebp),%eax
  105955:	89 44 24 04          	mov    %eax,0x4(%esp)
  105959:	c7 04 24 2d 00 00 00 	movl   $0x2d,(%esp)
  105960:	8b 45 08             	mov    0x8(%ebp),%eax
  105963:	ff d0                	call   *%eax
                num = -(long long)num;
  105965:	8b 45 f0             	mov    -0x10(%ebp),%eax
  105968:	8b 55 f4             	mov    -0xc(%ebp),%edx
  10596b:	f7 d8                	neg    %eax
  10596d:	83 d2 00             	adc    $0x0,%edx
  105970:	f7 da                	neg    %edx
  105972:	89 45 f0             	mov    %eax,-0x10(%ebp)
  105975:	89 55 f4             	mov    %edx,-0xc(%ebp)
            }
            base = 10;
  105978:	c7 45 ec 0a 00 00 00 	movl   $0xa,-0x14(%ebp)
            goto number;
  10597f:	e9 a8 00 00 00       	jmp    105a2c <vprintfmt+0x36a>

        // unsigned decimal
        case 'u':
            num = getuint(&ap, lflag);
  105984:	8b 45 e0             	mov    -0x20(%ebp),%eax
  105987:	89 44 24 04          	mov    %eax,0x4(%esp)
  10598b:	8d 45 14             	lea    0x14(%ebp),%eax
  10598e:	89 04 24             	mov    %eax,(%esp)
  105991:	e8 68 fc ff ff       	call   1055fe <getuint>
  105996:	89 45 f0             	mov    %eax,-0x10(%ebp)
  105999:	89 55 f4             	mov    %edx,-0xc(%ebp)
            base = 10;
  10599c:	c7 45 ec 0a 00 00 00 	movl   $0xa,-0x14(%ebp)
            goto number;
  1059a3:	e9 84 00 00 00       	jmp    105a2c <vprintfmt+0x36a>

        // (unsigned) octal
        case 'o':
            num = getuint(&ap, lflag);
  1059a8:	8b 45 e0             	mov    -0x20(%ebp),%eax
  1059ab:	89 44 24 04          	mov    %eax,0x4(%esp)
  1059af:	8d 45 14             	lea    0x14(%ebp),%eax
  1059b2:	89 04 24             	mov    %eax,(%esp)
  1059b5:	e8 44 fc ff ff       	call   1055fe <getuint>
  1059ba:	89 45 f0             	mov    %eax,-0x10(%ebp)
  1059bd:	89 55 f4             	mov    %edx,-0xc(%ebp)
            base = 8;
  1059c0:	c7 45 ec 08 00 00 00 	movl   $0x8,-0x14(%ebp)
            goto number;
  1059c7:	eb 63                	jmp    105a2c <vprintfmt+0x36a>

        // pointer
        case 'p':
            putch('0', putdat);
  1059c9:	8b 45 0c             	mov    0xc(%ebp),%eax
  1059cc:	89 44 24 04          	mov    %eax,0x4(%esp)
  1059d0:	c7 04 24 30 00 00 00 	movl   $0x30,(%esp)
  1059d7:	8b 45 08             	mov    0x8(%ebp),%eax
  1059da:	ff d0                	call   *%eax
            putch('x', putdat);
  1059dc:	8b 45 0c             	mov    0xc(%ebp),%eax
  1059df:	89 44 24 04          	mov    %eax,0x4(%esp)
  1059e3:	c7 04 24 78 00 00 00 	movl   $0x78,(%esp)
  1059ea:	8b 45 08             	mov    0x8(%ebp),%eax
  1059ed:	ff d0                	call   *%eax
            num = (unsigned long long)(uintptr_t)va_arg(ap, void *);
  1059ef:	8b 45 14             	mov    0x14(%ebp),%eax
  1059f2:	8d 50 04             	lea    0x4(%eax),%edx
  1059f5:	89 55 14             	mov    %edx,0x14(%ebp)
  1059f8:	8b 00                	mov    (%eax),%eax
  1059fa:	89 45 f0             	mov    %eax,-0x10(%ebp)
  1059fd:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)
            base = 16;
  105a04:	c7 45 ec 10 00 00 00 	movl   $0x10,-0x14(%ebp)
            goto number;
  105a0b:	eb 1f                	jmp    105a2c <vprintfmt+0x36a>

        // (unsigned) hexadecimal
        case 'x':
            num = getuint(&ap, lflag);
  105a0d:	8b 45 e0             	mov    -0x20(%ebp),%eax
  105a10:	89 44 24 04          	mov    %eax,0x4(%esp)
  105a14:	8d 45 14             	lea    0x14(%ebp),%eax
  105a17:	89 04 24             	mov    %eax,(%esp)
  105a1a:	e8 df fb ff ff       	call   1055fe <getuint>
  105a1f:	89 45 f0             	mov    %eax,-0x10(%ebp)
  105a22:	89 55 f4             	mov    %edx,-0xc(%ebp)
            base = 16;
  105a25:	c7 45 ec 10 00 00 00 	movl   $0x10,-0x14(%ebp)
        number:
            printnum(putch, putdat, num, base, width, padc);
  105a2c:	0f be 55 db          	movsbl -0x25(%ebp),%edx
  105a30:	8b 45 ec             	mov    -0x14(%ebp),%eax
  105a33:	89 54 24 18          	mov    %edx,0x18(%esp)
  105a37:	8b 55 e8             	mov    -0x18(%ebp),%edx
  105a3a:	89 54 24 14          	mov    %edx,0x14(%esp)
  105a3e:	89 44 24 10          	mov    %eax,0x10(%esp)
  105a42:	8b 45 f0             	mov    -0x10(%ebp),%eax
  105a45:	8b 55 f4             	mov    -0xc(%ebp),%edx
  105a48:	89 44 24 08          	mov    %eax,0x8(%esp)
  105a4c:	89 54 24 0c          	mov    %edx,0xc(%esp)
  105a50:	8b 45 0c             	mov    0xc(%ebp),%eax
  105a53:	89 44 24 04          	mov    %eax,0x4(%esp)
  105a57:	8b 45 08             	mov    0x8(%ebp),%eax
  105a5a:	89 04 24             	mov    %eax,(%esp)
  105a5d:	e8 97 fa ff ff       	call   1054f9 <printnum>
            break;
  105a62:	eb 3c                	jmp    105aa0 <vprintfmt+0x3de>

        // escaped '%' character
        case '%':
            putch(ch, putdat);
  105a64:	8b 45 0c             	mov    0xc(%ebp),%eax
  105a67:	89 44 24 04          	mov    %eax,0x4(%esp)
  105a6b:	89 1c 24             	mov    %ebx,(%esp)
  105a6e:	8b 45 08             	mov    0x8(%ebp),%eax
  105a71:	ff d0                	call   *%eax
            break;
  105a73:	eb 2b                	jmp    105aa0 <vprintfmt+0x3de>

        // unrecognized escape sequence - just print it literally
        default:
            putch('%', putdat);
  105a75:	8b 45 0c             	mov    0xc(%ebp),%eax
  105a78:	89 44 24 04          	mov    %eax,0x4(%esp)
  105a7c:	c7 04 24 25 00 00 00 	movl   $0x25,(%esp)
  105a83:	8b 45 08             	mov    0x8(%ebp),%eax
  105a86:	ff d0                	call   *%eax
            for (fmt --; fmt[-1] != '%'; fmt --)
  105a88:	83 6d 10 01          	subl   $0x1,0x10(%ebp)
  105a8c:	eb 04                	jmp    105a92 <vprintfmt+0x3d0>
  105a8e:	83 6d 10 01          	subl   $0x1,0x10(%ebp)
  105a92:	8b 45 10             	mov    0x10(%ebp),%eax
  105a95:	83 e8 01             	sub    $0x1,%eax
  105a98:	0f b6 00             	movzbl (%eax),%eax
  105a9b:	3c 25                	cmp    $0x25,%al
  105a9d:	75 ef                	jne    105a8e <vprintfmt+0x3cc>
                /* do nothing */;
            break;
  105a9f:	90                   	nop
        }
    }
  105aa0:	90                   	nop
    register int ch, err;
    unsigned long long num;
    int base, width, precision, lflag, altflag;

    while (1) {
        while ((ch = *(unsigned char *)fmt ++) != '%') {
  105aa1:	e9 3e fc ff ff       	jmp    1056e4 <vprintfmt+0x22>
            for (fmt --; fmt[-1] != '%'; fmt --)
                /* do nothing */;
            break;
        }
    }
}
  105aa6:	83 c4 40             	add    $0x40,%esp
  105aa9:	5b                   	pop    %ebx
  105aaa:	5e                   	pop    %esi
  105aab:	5d                   	pop    %ebp
  105aac:	c3                   	ret    

00105aad <sprintputch>:
 * sprintputch - 'print' a single character in a buffer
 * @ch:         the character will be printed
 * @b:          the buffer to place the character @ch
 * */
static void
sprintputch(int ch, struct sprintbuf *b) {
  105aad:	55                   	push   %ebp
  105aae:	89 e5                	mov    %esp,%ebp
    b->cnt ++;
  105ab0:	8b 45 0c             	mov    0xc(%ebp),%eax
  105ab3:	8b 40 08             	mov    0x8(%eax),%eax
  105ab6:	8d 50 01             	lea    0x1(%eax),%edx
  105ab9:	8b 45 0c             	mov    0xc(%ebp),%eax
  105abc:	89 50 08             	mov    %edx,0x8(%eax)
    if (b->buf < b->ebuf) {
  105abf:	8b 45 0c             	mov    0xc(%ebp),%eax
  105ac2:	8b 10                	mov    (%eax),%edx
  105ac4:	8b 45 0c             	mov    0xc(%ebp),%eax
  105ac7:	8b 40 04             	mov    0x4(%eax),%eax
  105aca:	39 c2                	cmp    %eax,%edx
  105acc:	73 12                	jae    105ae0 <sprintputch+0x33>
        *b->buf ++ = ch;
  105ace:	8b 45 0c             	mov    0xc(%ebp),%eax
  105ad1:	8b 00                	mov    (%eax),%eax
  105ad3:	8d 48 01             	lea    0x1(%eax),%ecx
  105ad6:	8b 55 0c             	mov    0xc(%ebp),%edx
  105ad9:	89 0a                	mov    %ecx,(%edx)
  105adb:	8b 55 08             	mov    0x8(%ebp),%edx
  105ade:	88 10                	mov    %dl,(%eax)
    }
}
  105ae0:	5d                   	pop    %ebp
  105ae1:	c3                   	ret    

00105ae2 <snprintf>:
 * @str:        the buffer to place the result into
 * @size:       the size of buffer, including the trailing null space
 * @fmt:        the format string to use
 * */
int
snprintf(char *str, size_t size, const char *fmt, ...) {
  105ae2:	55                   	push   %ebp
  105ae3:	89 e5                	mov    %esp,%ebp
  105ae5:	83 ec 28             	sub    $0x28,%esp
    va_list ap;
    int cnt;
    va_start(ap, fmt);
  105ae8:	8d 45 14             	lea    0x14(%ebp),%eax
  105aeb:	89 45 f0             	mov    %eax,-0x10(%ebp)
    cnt = vsnprintf(str, size, fmt, ap);
  105aee:	8b 45 f0             	mov    -0x10(%ebp),%eax
  105af1:	89 44 24 0c          	mov    %eax,0xc(%esp)
  105af5:	8b 45 10             	mov    0x10(%ebp),%eax
  105af8:	89 44 24 08          	mov    %eax,0x8(%esp)
  105afc:	8b 45 0c             	mov    0xc(%ebp),%eax
  105aff:	89 44 24 04          	mov    %eax,0x4(%esp)
  105b03:	8b 45 08             	mov    0x8(%ebp),%eax
  105b06:	89 04 24             	mov    %eax,(%esp)
  105b09:	e8 08 00 00 00       	call   105b16 <vsnprintf>
  105b0e:	89 45 f4             	mov    %eax,-0xc(%ebp)
    va_end(ap);
    return cnt;
  105b11:	8b 45 f4             	mov    -0xc(%ebp),%eax
}
  105b14:	c9                   	leave  
  105b15:	c3                   	ret    

00105b16 <vsnprintf>:
 *
 * Call this function if you are already dealing with a va_list.
 * Or you probably want snprintf() instead.
 * */
int
vsnprintf(char *str, size_t size, const char *fmt, va_list ap) {
  105b16:	55                   	push   %ebp
  105b17:	89 e5                	mov    %esp,%ebp
  105b19:	83 ec 28             	sub    $0x28,%esp
    struct sprintbuf b = {str, str + size - 1, 0};
  105b1c:	8b 45 08             	mov    0x8(%ebp),%eax
  105b1f:	89 45 ec             	mov    %eax,-0x14(%ebp)
  105b22:	8b 45 0c             	mov    0xc(%ebp),%eax
  105b25:	8d 50 ff             	lea    -0x1(%eax),%edx
  105b28:	8b 45 08             	mov    0x8(%ebp),%eax
  105b2b:	01 d0                	add    %edx,%eax
  105b2d:	89 45 f0             	mov    %eax,-0x10(%ebp)
  105b30:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)
    if (str == NULL || b.buf > b.ebuf) {
  105b37:	83 7d 08 00          	cmpl   $0x0,0x8(%ebp)
  105b3b:	74 0a                	je     105b47 <vsnprintf+0x31>
  105b3d:	8b 55 ec             	mov    -0x14(%ebp),%edx
  105b40:	8b 45 f0             	mov    -0x10(%ebp),%eax
  105b43:	39 c2                	cmp    %eax,%edx
  105b45:	76 07                	jbe    105b4e <vsnprintf+0x38>
        return -E_INVAL;
  105b47:	b8 fd ff ff ff       	mov    $0xfffffffd,%eax
  105b4c:	eb 2a                	jmp    105b78 <vsnprintf+0x62>
    }
    // print the string to the buffer
    vprintfmt((void*)sprintputch, &b, fmt, ap);
  105b4e:	8b 45 14             	mov    0x14(%ebp),%eax
  105b51:	89 44 24 0c          	mov    %eax,0xc(%esp)
  105b55:	8b 45 10             	mov    0x10(%ebp),%eax
  105b58:	89 44 24 08          	mov    %eax,0x8(%esp)
  105b5c:	8d 45 ec             	lea    -0x14(%ebp),%eax
  105b5f:	89 44 24 04          	mov    %eax,0x4(%esp)
  105b63:	c7 04 24 ad 5a 10 00 	movl   $0x105aad,(%esp)
  105b6a:	e8 53 fb ff ff       	call   1056c2 <vprintfmt>
    // null terminate the buffer
    *b.buf = '\0';
  105b6f:	8b 45 ec             	mov    -0x14(%ebp),%eax
  105b72:	c6 00 00             	movb   $0x0,(%eax)
    return b.cnt;
  105b75:	8b 45 f4             	mov    -0xc(%ebp),%eax
}
  105b78:	c9                   	leave  
  105b79:	c3                   	ret    

00105b7a <strlen>:
 * @s:      the input string
 *
 * The strlen() function returns the length of string @s.
 * */
size_t
strlen(const char *s) {
  105b7a:	55                   	push   %ebp
  105b7b:	89 e5                	mov    %esp,%ebp
  105b7d:	83 ec 10             	sub    $0x10,%esp
    size_t cnt = 0;
  105b80:	c7 45 fc 00 00 00 00 	movl   $0x0,-0x4(%ebp)
    while (*s ++ != '\0') {
  105b87:	eb 04                	jmp    105b8d <strlen+0x13>
        cnt ++;
  105b89:	83 45 fc 01          	addl   $0x1,-0x4(%ebp)
 * The strlen() function returns the length of string @s.
 * */
size_t
strlen(const char *s) {
    size_t cnt = 0;
    while (*s ++ != '\0') {
  105b8d:	8b 45 08             	mov    0x8(%ebp),%eax
  105b90:	8d 50 01             	lea    0x1(%eax),%edx
  105b93:	89 55 08             	mov    %edx,0x8(%ebp)
  105b96:	0f b6 00             	movzbl (%eax),%eax
  105b99:	84 c0                	test   %al,%al
  105b9b:	75 ec                	jne    105b89 <strlen+0xf>
        cnt ++;
    }
    return cnt;
  105b9d:	8b 45 fc             	mov    -0x4(%ebp),%eax
}
  105ba0:	c9                   	leave  
  105ba1:	c3                   	ret    

00105ba2 <strnlen>:
 * The return value is strlen(s), if that is less than @len, or
 * @len if there is no '\0' character among the first @len characters
 * pointed by @s.
 * */
size_t
strnlen(const char *s, size_t len) {
  105ba2:	55                   	push   %ebp
  105ba3:	89 e5                	mov    %esp,%ebp
  105ba5:	83 ec 10             	sub    $0x10,%esp
    size_t cnt = 0;
  105ba8:	c7 45 fc 00 00 00 00 	movl   $0x0,-0x4(%ebp)
    while (cnt < len && *s ++ != '\0') {
  105baf:	eb 04                	jmp    105bb5 <strnlen+0x13>
        cnt ++;
  105bb1:	83 45 fc 01          	addl   $0x1,-0x4(%ebp)
 * pointed by @s.
 * */
size_t
strnlen(const char *s, size_t len) {
    size_t cnt = 0;
    while (cnt < len && *s ++ != '\0') {
  105bb5:	8b 45 fc             	mov    -0x4(%ebp),%eax
  105bb8:	3b 45 0c             	cmp    0xc(%ebp),%eax
  105bbb:	73 10                	jae    105bcd <strnlen+0x2b>
  105bbd:	8b 45 08             	mov    0x8(%ebp),%eax
  105bc0:	8d 50 01             	lea    0x1(%eax),%edx
  105bc3:	89 55 08             	mov    %edx,0x8(%ebp)
  105bc6:	0f b6 00             	movzbl (%eax),%eax
  105bc9:	84 c0                	test   %al,%al
  105bcb:	75 e4                	jne    105bb1 <strnlen+0xf>
        cnt ++;
    }
    return cnt;
  105bcd:	8b 45 fc             	mov    -0x4(%ebp),%eax
}
  105bd0:	c9                   	leave  
  105bd1:	c3                   	ret    

00105bd2 <strcpy>:
 * To avoid overflows, the size of array pointed by @dst should be long enough to
 * contain the same string as @src (including the terminating null character), and
 * should not overlap in memory with @src.
 * */
char *
strcpy(char *dst, const char *src) {
  105bd2:	55                   	push   %ebp
  105bd3:	89 e5                	mov    %esp,%ebp
  105bd5:	57                   	push   %edi
  105bd6:	56                   	push   %esi
  105bd7:	83 ec 20             	sub    $0x20,%esp
  105bda:	8b 45 08             	mov    0x8(%ebp),%eax
  105bdd:	89 45 f4             	mov    %eax,-0xc(%ebp)
  105be0:	8b 45 0c             	mov    0xc(%ebp),%eax
  105be3:	89 45 f0             	mov    %eax,-0x10(%ebp)
#ifndef __HAVE_ARCH_STRCPY
#define __HAVE_ARCH_STRCPY
static inline char *
__strcpy(char *dst, const char *src) {
    int d0, d1, d2;
    asm volatile (
  105be6:	8b 55 f0             	mov    -0x10(%ebp),%edx
  105be9:	8b 45 f4             	mov    -0xc(%ebp),%eax
  105bec:	89 d1                	mov    %edx,%ecx
  105bee:	89 c2                	mov    %eax,%edx
  105bf0:	89 ce                	mov    %ecx,%esi
  105bf2:	89 d7                	mov    %edx,%edi
  105bf4:	ac                   	lods   %ds:(%esi),%al
  105bf5:	aa                   	stos   %al,%es:(%edi)
  105bf6:	84 c0                	test   %al,%al
  105bf8:	75 fa                	jne    105bf4 <strcpy+0x22>
  105bfa:	89 fa                	mov    %edi,%edx
  105bfc:	89 f1                	mov    %esi,%ecx
  105bfe:	89 4d ec             	mov    %ecx,-0x14(%ebp)
  105c01:	89 55 e8             	mov    %edx,-0x18(%ebp)
  105c04:	89 45 e4             	mov    %eax,-0x1c(%ebp)
        "stosb;"
        "testb %%al, %%al;"
        "jne 1b;"
        : "=&S" (d0), "=&D" (d1), "=&a" (d2)
        : "0" (src), "1" (dst) : "memory");
    return dst;
  105c07:	8b 45 f4             	mov    -0xc(%ebp),%eax
    char *p = dst;
    while ((*p ++ = *src ++) != '\0')
        /* nothing */;
    return dst;
#endif /* __HAVE_ARCH_STRCPY */
}
  105c0a:	83 c4 20             	add    $0x20,%esp
  105c0d:	5e                   	pop    %esi
  105c0e:	5f                   	pop    %edi
  105c0f:	5d                   	pop    %ebp
  105c10:	c3                   	ret    

00105c11 <strncpy>:
 * @len:    maximum number of characters to be copied from @src
 *
 * The return value is @dst
 * */
char *
strncpy(char *dst, const char *src, size_t len) {
  105c11:	55                   	push   %ebp
  105c12:	89 e5                	mov    %esp,%ebp
  105c14:	83 ec 10             	sub    $0x10,%esp
    char *p = dst;
  105c17:	8b 45 08             	mov    0x8(%ebp),%eax
  105c1a:	89 45 fc             	mov    %eax,-0x4(%ebp)
    while (len > 0) {
  105c1d:	eb 21                	jmp    105c40 <strncpy+0x2f>
        if ((*p = *src) != '\0') {
  105c1f:	8b 45 0c             	mov    0xc(%ebp),%eax
  105c22:	0f b6 10             	movzbl (%eax),%edx
  105c25:	8b 45 fc             	mov    -0x4(%ebp),%eax
  105c28:	88 10                	mov    %dl,(%eax)
  105c2a:	8b 45 fc             	mov    -0x4(%ebp),%eax
  105c2d:	0f b6 00             	movzbl (%eax),%eax
  105c30:	84 c0                	test   %al,%al
  105c32:	74 04                	je     105c38 <strncpy+0x27>
            src ++;
  105c34:	83 45 0c 01          	addl   $0x1,0xc(%ebp)
        }
        p ++, len --;
  105c38:	83 45 fc 01          	addl   $0x1,-0x4(%ebp)
  105c3c:	83 6d 10 01          	subl   $0x1,0x10(%ebp)
 * The return value is @dst
 * */
char *
strncpy(char *dst, const char *src, size_t len) {
    char *p = dst;
    while (len > 0) {
  105c40:	83 7d 10 00          	cmpl   $0x0,0x10(%ebp)
  105c44:	75 d9                	jne    105c1f <strncpy+0xe>
        if ((*p = *src) != '\0') {
            src ++;
        }
        p ++, len --;
    }
    return dst;
  105c46:	8b 45 08             	mov    0x8(%ebp),%eax
}
  105c49:	c9                   	leave  
  105c4a:	c3                   	ret    

00105c4b <strcmp>:
 * - A value greater than zero indicates that the first character that does
 *   not match has a greater value in @s1 than in @s2;
 * - And a value less than zero indicates the opposite.
 * */
int
strcmp(const char *s1, const char *s2) {
  105c4b:	55                   	push   %ebp
  105c4c:	89 e5                	mov    %esp,%ebp
  105c4e:	57                   	push   %edi
  105c4f:	56                   	push   %esi
  105c50:	83 ec 20             	sub    $0x20,%esp
  105c53:	8b 45 08             	mov    0x8(%ebp),%eax
  105c56:	89 45 f4             	mov    %eax,-0xc(%ebp)
  105c59:	8b 45 0c             	mov    0xc(%ebp),%eax
  105c5c:	89 45 f0             	mov    %eax,-0x10(%ebp)
#ifndef __HAVE_ARCH_STRCMP
#define __HAVE_ARCH_STRCMP
static inline int
__strcmp(const char *s1, const char *s2) {
    int d0, d1, ret;
    asm volatile (
  105c5f:	8b 55 f4             	mov    -0xc(%ebp),%edx
  105c62:	8b 45 f0             	mov    -0x10(%ebp),%eax
  105c65:	89 d1                	mov    %edx,%ecx
  105c67:	89 c2                	mov    %eax,%edx
  105c69:	89 ce                	mov    %ecx,%esi
  105c6b:	89 d7                	mov    %edx,%edi
  105c6d:	ac                   	lods   %ds:(%esi),%al
  105c6e:	ae                   	scas   %es:(%edi),%al
  105c6f:	75 08                	jne    105c79 <strcmp+0x2e>
  105c71:	84 c0                	test   %al,%al
  105c73:	75 f8                	jne    105c6d <strcmp+0x22>
  105c75:	31 c0                	xor    %eax,%eax
  105c77:	eb 04                	jmp    105c7d <strcmp+0x32>
  105c79:	19 c0                	sbb    %eax,%eax
  105c7b:	0c 01                	or     $0x1,%al
  105c7d:	89 fa                	mov    %edi,%edx
  105c7f:	89 f1                	mov    %esi,%ecx
  105c81:	89 45 ec             	mov    %eax,-0x14(%ebp)
  105c84:	89 4d e8             	mov    %ecx,-0x18(%ebp)
  105c87:	89 55 e4             	mov    %edx,-0x1c(%ebp)
        "orb $1, %%al;"
        "3:"
        : "=a" (ret), "=&S" (d0), "=&D" (d1)
        : "1" (s1), "2" (s2)
        : "memory");
    return ret;
  105c8a:	8b 45 ec             	mov    -0x14(%ebp),%eax
    while (*s1 != '\0' && *s1 == *s2) {
        s1 ++, s2 ++;
    }
    return (int)((unsigned char)*s1 - (unsigned char)*s2);
#endif /* __HAVE_ARCH_STRCMP */
}
  105c8d:	83 c4 20             	add    $0x20,%esp
  105c90:	5e                   	pop    %esi
  105c91:	5f                   	pop    %edi
  105c92:	5d                   	pop    %ebp
  105c93:	c3                   	ret    

00105c94 <strncmp>:
 * they are equal to each other, it continues with the following pairs until
 * the characters differ, until a terminating null-character is reached, or
 * until @n characters match in both strings, whichever happens first.
 * */
int
strncmp(const char *s1, const char *s2, size_t n) {
  105c94:	55                   	push   %ebp
  105c95:	89 e5                	mov    %esp,%ebp
    while (n > 0 && *s1 != '\0' && *s1 == *s2) {
  105c97:	eb 0c                	jmp    105ca5 <strncmp+0x11>
        n --, s1 ++, s2 ++;
  105c99:	83 6d 10 01          	subl   $0x1,0x10(%ebp)
  105c9d:	83 45 08 01          	addl   $0x1,0x8(%ebp)
  105ca1:	83 45 0c 01          	addl   $0x1,0xc(%ebp)
 * the characters differ, until a terminating null-character is reached, or
 * until @n characters match in both strings, whichever happens first.
 * */
int
strncmp(const char *s1, const char *s2, size_t n) {
    while (n > 0 && *s1 != '\0' && *s1 == *s2) {
  105ca5:	83 7d 10 00          	cmpl   $0x0,0x10(%ebp)
  105ca9:	74 1a                	je     105cc5 <strncmp+0x31>
  105cab:	8b 45 08             	mov    0x8(%ebp),%eax
  105cae:	0f b6 00             	movzbl (%eax),%eax
  105cb1:	84 c0                	test   %al,%al
  105cb3:	74 10                	je     105cc5 <strncmp+0x31>
  105cb5:	8b 45 08             	mov    0x8(%ebp),%eax
  105cb8:	0f b6 10             	movzbl (%eax),%edx
  105cbb:	8b 45 0c             	mov    0xc(%ebp),%eax
  105cbe:	0f b6 00             	movzbl (%eax),%eax
  105cc1:	38 c2                	cmp    %al,%dl
  105cc3:	74 d4                	je     105c99 <strncmp+0x5>
        n --, s1 ++, s2 ++;
    }
    return (n == 0) ? 0 : (int)((unsigned char)*s1 - (unsigned char)*s2);
  105cc5:	83 7d 10 00          	cmpl   $0x0,0x10(%ebp)
  105cc9:	74 18                	je     105ce3 <strncmp+0x4f>
  105ccb:	8b 45 08             	mov    0x8(%ebp),%eax
  105cce:	0f b6 00             	movzbl (%eax),%eax
  105cd1:	0f b6 d0             	movzbl %al,%edx
  105cd4:	8b 45 0c             	mov    0xc(%ebp),%eax
  105cd7:	0f b6 00             	movzbl (%eax),%eax
  105cda:	0f b6 c0             	movzbl %al,%eax
  105cdd:	29 c2                	sub    %eax,%edx
  105cdf:	89 d0                	mov    %edx,%eax
  105ce1:	eb 05                	jmp    105ce8 <strncmp+0x54>
  105ce3:	b8 00 00 00 00       	mov    $0x0,%eax
}
  105ce8:	5d                   	pop    %ebp
  105ce9:	c3                   	ret    

00105cea <strchr>:
 *
 * The strchr() function returns a pointer to the first occurrence of
 * character in @s. If the value is not found, the function returns 'NULL'.
 * */
char *
strchr(const char *s, char c) {
  105cea:	55                   	push   %ebp
  105ceb:	89 e5                	mov    %esp,%ebp
  105ced:	83 ec 04             	sub    $0x4,%esp
  105cf0:	8b 45 0c             	mov    0xc(%ebp),%eax
  105cf3:	88 45 fc             	mov    %al,-0x4(%ebp)
    while (*s != '\0') {
  105cf6:	eb 14                	jmp    105d0c <strchr+0x22>
        if (*s == c) {
  105cf8:	8b 45 08             	mov    0x8(%ebp),%eax
  105cfb:	0f b6 00             	movzbl (%eax),%eax
  105cfe:	3a 45 fc             	cmp    -0x4(%ebp),%al
  105d01:	75 05                	jne    105d08 <strchr+0x1e>
            return (char *)s;
  105d03:	8b 45 08             	mov    0x8(%ebp),%eax
  105d06:	eb 13                	jmp    105d1b <strchr+0x31>
        }
        s ++;
  105d08:	83 45 08 01          	addl   $0x1,0x8(%ebp)
 * The strchr() function returns a pointer to the first occurrence of
 * character in @s. If the value is not found, the function returns 'NULL'.
 * */
char *
strchr(const char *s, char c) {
    while (*s != '\0') {
  105d0c:	8b 45 08             	mov    0x8(%ebp),%eax
  105d0f:	0f b6 00             	movzbl (%eax),%eax
  105d12:	84 c0                	test   %al,%al
  105d14:	75 e2                	jne    105cf8 <strchr+0xe>
        if (*s == c) {
            return (char *)s;
        }
        s ++;
    }
    return NULL;
  105d16:	b8 00 00 00 00       	mov    $0x0,%eax
}
  105d1b:	c9                   	leave  
  105d1c:	c3                   	ret    

00105d1d <strfind>:
 * The strfind() function is like strchr() except that if @c is
 * not found in @s, then it returns a pointer to the null byte at the
 * end of @s, rather than 'NULL'.
 * */
char *
strfind(const char *s, char c) {
  105d1d:	55                   	push   %ebp
  105d1e:	89 e5                	mov    %esp,%ebp
  105d20:	83 ec 04             	sub    $0x4,%esp
  105d23:	8b 45 0c             	mov    0xc(%ebp),%eax
  105d26:	88 45 fc             	mov    %al,-0x4(%ebp)
    while (*s != '\0') {
  105d29:	eb 11                	jmp    105d3c <strfind+0x1f>
        if (*s == c) {
  105d2b:	8b 45 08             	mov    0x8(%ebp),%eax
  105d2e:	0f b6 00             	movzbl (%eax),%eax
  105d31:	3a 45 fc             	cmp    -0x4(%ebp),%al
  105d34:	75 02                	jne    105d38 <strfind+0x1b>
            break;
  105d36:	eb 0e                	jmp    105d46 <strfind+0x29>
        }
        s ++;
  105d38:	83 45 08 01          	addl   $0x1,0x8(%ebp)
 * not found in @s, then it returns a pointer to the null byte at the
 * end of @s, rather than 'NULL'.
 * */
char *
strfind(const char *s, char c) {
    while (*s != '\0') {
  105d3c:	8b 45 08             	mov    0x8(%ebp),%eax
  105d3f:	0f b6 00             	movzbl (%eax),%eax
  105d42:	84 c0                	test   %al,%al
  105d44:	75 e5                	jne    105d2b <strfind+0xe>
        if (*s == c) {
            break;
        }
        s ++;
    }
    return (char *)s;
  105d46:	8b 45 08             	mov    0x8(%ebp),%eax
}
  105d49:	c9                   	leave  
  105d4a:	c3                   	ret    

00105d4b <strtol>:
 * an optional "0x" or "0X" prefix.
 *
 * The strtol() function returns the converted integral number as a long int value.
 * */
long
strtol(const char *s, char **endptr, int base) {
  105d4b:	55                   	push   %ebp
  105d4c:	89 e5                	mov    %esp,%ebp
  105d4e:	83 ec 10             	sub    $0x10,%esp
    int neg = 0;
  105d51:	c7 45 fc 00 00 00 00 	movl   $0x0,-0x4(%ebp)
    long val = 0;
  105d58:	c7 45 f8 00 00 00 00 	movl   $0x0,-0x8(%ebp)

    // gobble initial whitespace
    while (*s == ' ' || *s == '\t') {
  105d5f:	eb 04                	jmp    105d65 <strtol+0x1a>
        s ++;
  105d61:	83 45 08 01          	addl   $0x1,0x8(%ebp)
strtol(const char *s, char **endptr, int base) {
    int neg = 0;
    long val = 0;

    // gobble initial whitespace
    while (*s == ' ' || *s == '\t') {
  105d65:	8b 45 08             	mov    0x8(%ebp),%eax
  105d68:	0f b6 00             	movzbl (%eax),%eax
  105d6b:	3c 20                	cmp    $0x20,%al
  105d6d:	74 f2                	je     105d61 <strtol+0x16>
  105d6f:	8b 45 08             	mov    0x8(%ebp),%eax
  105d72:	0f b6 00             	movzbl (%eax),%eax
  105d75:	3c 09                	cmp    $0x9,%al
  105d77:	74 e8                	je     105d61 <strtol+0x16>
        s ++;
    }

    // plus/minus sign
    if (*s == '+') {
  105d79:	8b 45 08             	mov    0x8(%ebp),%eax
  105d7c:	0f b6 00             	movzbl (%eax),%eax
  105d7f:	3c 2b                	cmp    $0x2b,%al
  105d81:	75 06                	jne    105d89 <strtol+0x3e>
        s ++;
  105d83:	83 45 08 01          	addl   $0x1,0x8(%ebp)
  105d87:	eb 15                	jmp    105d9e <strtol+0x53>
    }
    else if (*s == '-') {
  105d89:	8b 45 08             	mov    0x8(%ebp),%eax
  105d8c:	0f b6 00             	movzbl (%eax),%eax
  105d8f:	3c 2d                	cmp    $0x2d,%al
  105d91:	75 0b                	jne    105d9e <strtol+0x53>
        s ++, neg = 1;
  105d93:	83 45 08 01          	addl   $0x1,0x8(%ebp)
  105d97:	c7 45 fc 01 00 00 00 	movl   $0x1,-0x4(%ebp)
    }

    // hex or octal base prefix
    if ((base == 0 || base == 16) && (s[0] == '0' && s[1] == 'x')) {
  105d9e:	83 7d 10 00          	cmpl   $0x0,0x10(%ebp)
  105da2:	74 06                	je     105daa <strtol+0x5f>
  105da4:	83 7d 10 10          	cmpl   $0x10,0x10(%ebp)
  105da8:	75 24                	jne    105dce <strtol+0x83>
  105daa:	8b 45 08             	mov    0x8(%ebp),%eax
  105dad:	0f b6 00             	movzbl (%eax),%eax
  105db0:	3c 30                	cmp    $0x30,%al
  105db2:	75 1a                	jne    105dce <strtol+0x83>
  105db4:	8b 45 08             	mov    0x8(%ebp),%eax
  105db7:	83 c0 01             	add    $0x1,%eax
  105dba:	0f b6 00             	movzbl (%eax),%eax
  105dbd:	3c 78                	cmp    $0x78,%al
  105dbf:	75 0d                	jne    105dce <strtol+0x83>
        s += 2, base = 16;
  105dc1:	83 45 08 02          	addl   $0x2,0x8(%ebp)
  105dc5:	c7 45 10 10 00 00 00 	movl   $0x10,0x10(%ebp)
  105dcc:	eb 2a                	jmp    105df8 <strtol+0xad>
    }
    else if (base == 0 && s[0] == '0') {
  105dce:	83 7d 10 00          	cmpl   $0x0,0x10(%ebp)
  105dd2:	75 17                	jne    105deb <strtol+0xa0>
  105dd4:	8b 45 08             	mov    0x8(%ebp),%eax
  105dd7:	0f b6 00             	movzbl (%eax),%eax
  105dda:	3c 30                	cmp    $0x30,%al
  105ddc:	75 0d                	jne    105deb <strtol+0xa0>
        s ++, base = 8;
  105dde:	83 45 08 01          	addl   $0x1,0x8(%ebp)
  105de2:	c7 45 10 08 00 00 00 	movl   $0x8,0x10(%ebp)
  105de9:	eb 0d                	jmp    105df8 <strtol+0xad>
    }
    else if (base == 0) {
  105deb:	83 7d 10 00          	cmpl   $0x0,0x10(%ebp)
  105def:	75 07                	jne    105df8 <strtol+0xad>
        base = 10;
  105df1:	c7 45 10 0a 00 00 00 	movl   $0xa,0x10(%ebp)

    // digits
    while (1) {
        int dig;

        if (*s >= '0' && *s <= '9') {
  105df8:	8b 45 08             	mov    0x8(%ebp),%eax
  105dfb:	0f b6 00             	movzbl (%eax),%eax
  105dfe:	3c 2f                	cmp    $0x2f,%al
  105e00:	7e 1b                	jle    105e1d <strtol+0xd2>
  105e02:	8b 45 08             	mov    0x8(%ebp),%eax
  105e05:	0f b6 00             	movzbl (%eax),%eax
  105e08:	3c 39                	cmp    $0x39,%al
  105e0a:	7f 11                	jg     105e1d <strtol+0xd2>
            dig = *s - '0';
  105e0c:	8b 45 08             	mov    0x8(%ebp),%eax
  105e0f:	0f b6 00             	movzbl (%eax),%eax
  105e12:	0f be c0             	movsbl %al,%eax
  105e15:	83 e8 30             	sub    $0x30,%eax
  105e18:	89 45 f4             	mov    %eax,-0xc(%ebp)
  105e1b:	eb 48                	jmp    105e65 <strtol+0x11a>
        }
        else if (*s >= 'a' && *s <= 'z') {
  105e1d:	8b 45 08             	mov    0x8(%ebp),%eax
  105e20:	0f b6 00             	movzbl (%eax),%eax
  105e23:	3c 60                	cmp    $0x60,%al
  105e25:	7e 1b                	jle    105e42 <strtol+0xf7>
  105e27:	8b 45 08             	mov    0x8(%ebp),%eax
  105e2a:	0f b6 00             	movzbl (%eax),%eax
  105e2d:	3c 7a                	cmp    $0x7a,%al
  105e2f:	7f 11                	jg     105e42 <strtol+0xf7>
            dig = *s - 'a' + 10;
  105e31:	8b 45 08             	mov    0x8(%ebp),%eax
  105e34:	0f b6 00             	movzbl (%eax),%eax
  105e37:	0f be c0             	movsbl %al,%eax
  105e3a:	83 e8 57             	sub    $0x57,%eax
  105e3d:	89 45 f4             	mov    %eax,-0xc(%ebp)
  105e40:	eb 23                	jmp    105e65 <strtol+0x11a>
        }
        else if (*s >= 'A' && *s <= 'Z') {
  105e42:	8b 45 08             	mov    0x8(%ebp),%eax
  105e45:	0f b6 00             	movzbl (%eax),%eax
  105e48:	3c 40                	cmp    $0x40,%al
  105e4a:	7e 3d                	jle    105e89 <strtol+0x13e>
  105e4c:	8b 45 08             	mov    0x8(%ebp),%eax
  105e4f:	0f b6 00             	movzbl (%eax),%eax
  105e52:	3c 5a                	cmp    $0x5a,%al
  105e54:	7f 33                	jg     105e89 <strtol+0x13e>
            dig = *s - 'A' + 10;
  105e56:	8b 45 08             	mov    0x8(%ebp),%eax
  105e59:	0f b6 00             	movzbl (%eax),%eax
  105e5c:	0f be c0             	movsbl %al,%eax
  105e5f:	83 e8 37             	sub    $0x37,%eax
  105e62:	89 45 f4             	mov    %eax,-0xc(%ebp)
        }
        else {
            break;
        }
        if (dig >= base) {
  105e65:	8b 45 f4             	mov    -0xc(%ebp),%eax
  105e68:	3b 45 10             	cmp    0x10(%ebp),%eax
  105e6b:	7c 02                	jl     105e6f <strtol+0x124>
            break;
  105e6d:	eb 1a                	jmp    105e89 <strtol+0x13e>
        }
        s ++, val = (val * base) + dig;
  105e6f:	83 45 08 01          	addl   $0x1,0x8(%ebp)
  105e73:	8b 45 f8             	mov    -0x8(%ebp),%eax
  105e76:	0f af 45 10          	imul   0x10(%ebp),%eax
  105e7a:	89 c2                	mov    %eax,%edx
  105e7c:	8b 45 f4             	mov    -0xc(%ebp),%eax
  105e7f:	01 d0                	add    %edx,%eax
  105e81:	89 45 f8             	mov    %eax,-0x8(%ebp)
        // we don't properly detect overflow!
    }
  105e84:	e9 6f ff ff ff       	jmp    105df8 <strtol+0xad>

    if (endptr) {
  105e89:	83 7d 0c 00          	cmpl   $0x0,0xc(%ebp)
  105e8d:	74 08                	je     105e97 <strtol+0x14c>
        *endptr = (char *) s;
  105e8f:	8b 45 0c             	mov    0xc(%ebp),%eax
  105e92:	8b 55 08             	mov    0x8(%ebp),%edx
  105e95:	89 10                	mov    %edx,(%eax)
    }
    return (neg ? -val : val);
  105e97:	83 7d fc 00          	cmpl   $0x0,-0x4(%ebp)
  105e9b:	74 07                	je     105ea4 <strtol+0x159>
  105e9d:	8b 45 f8             	mov    -0x8(%ebp),%eax
  105ea0:	f7 d8                	neg    %eax
  105ea2:	eb 03                	jmp    105ea7 <strtol+0x15c>
  105ea4:	8b 45 f8             	mov    -0x8(%ebp),%eax
}
  105ea7:	c9                   	leave  
  105ea8:	c3                   	ret    

00105ea9 <memset>:
 * @n:      number of bytes to be set to the value
 *
 * The memset() function returns @s.
 * */
void *
memset(void *s, char c, size_t n) {
  105ea9:	55                   	push   %ebp
  105eaa:	89 e5                	mov    %esp,%ebp
  105eac:	57                   	push   %edi
  105ead:	83 ec 24             	sub    $0x24,%esp
  105eb0:	8b 45 0c             	mov    0xc(%ebp),%eax
  105eb3:	88 45 d8             	mov    %al,-0x28(%ebp)
#ifdef __HAVE_ARCH_MEMSET
    return __memset(s, c, n);
  105eb6:	0f be 45 d8          	movsbl -0x28(%ebp),%eax
  105eba:	8b 55 08             	mov    0x8(%ebp),%edx
  105ebd:	89 55 f8             	mov    %edx,-0x8(%ebp)
  105ec0:	88 45 f7             	mov    %al,-0x9(%ebp)
  105ec3:	8b 45 10             	mov    0x10(%ebp),%eax
  105ec6:	89 45 f0             	mov    %eax,-0x10(%ebp)
#ifndef __HAVE_ARCH_MEMSET
#define __HAVE_ARCH_MEMSET
static inline void *
__memset(void *s, char c, size_t n) {
    int d0, d1;
    asm volatile (
  105ec9:	8b 4d f0             	mov    -0x10(%ebp),%ecx
  105ecc:	0f b6 45 f7          	movzbl -0x9(%ebp),%eax
  105ed0:	8b 55 f8             	mov    -0x8(%ebp),%edx
  105ed3:	89 d7                	mov    %edx,%edi
  105ed5:	f3 aa                	rep stos %al,%es:(%edi)
  105ed7:	89 fa                	mov    %edi,%edx
  105ed9:	89 4d ec             	mov    %ecx,-0x14(%ebp)
  105edc:	89 55 e8             	mov    %edx,-0x18(%ebp)
        "rep; stosb;"
        : "=&c" (d0), "=&D" (d1)
        : "0" (n), "a" (c), "1" (s)
        : "memory");
    return s;
  105edf:	8b 45 f8             	mov    -0x8(%ebp),%eax
    while (n -- > 0) {
        *p ++ = c;
    }
    return s;
#endif /* __HAVE_ARCH_MEMSET */
}
  105ee2:	83 c4 24             	add    $0x24,%esp
  105ee5:	5f                   	pop    %edi
  105ee6:	5d                   	pop    %ebp
  105ee7:	c3                   	ret    

00105ee8 <memmove>:
 * @n:      number of bytes to copy
 *
 * The memmove() function returns @dst.
 * */
void *
memmove(void *dst, const void *src, size_t n) {
  105ee8:	55                   	push   %ebp
  105ee9:	89 e5                	mov    %esp,%ebp
  105eeb:	57                   	push   %edi
  105eec:	56                   	push   %esi
  105eed:	53                   	push   %ebx
  105eee:	83 ec 30             	sub    $0x30,%esp
  105ef1:	8b 45 08             	mov    0x8(%ebp),%eax
  105ef4:	89 45 f0             	mov    %eax,-0x10(%ebp)
  105ef7:	8b 45 0c             	mov    0xc(%ebp),%eax
  105efa:	89 45 ec             	mov    %eax,-0x14(%ebp)
  105efd:	8b 45 10             	mov    0x10(%ebp),%eax
  105f00:	89 45 e8             	mov    %eax,-0x18(%ebp)

#ifndef __HAVE_ARCH_MEMMOVE
#define __HAVE_ARCH_MEMMOVE
static inline void *
__memmove(void *dst, const void *src, size_t n) {
    if (dst < src) {
  105f03:	8b 45 f0             	mov    -0x10(%ebp),%eax
  105f06:	3b 45 ec             	cmp    -0x14(%ebp),%eax
  105f09:	73 42                	jae    105f4d <memmove+0x65>
  105f0b:	8b 45 f0             	mov    -0x10(%ebp),%eax
  105f0e:	89 45 e4             	mov    %eax,-0x1c(%ebp)
  105f11:	8b 45 ec             	mov    -0x14(%ebp),%eax
  105f14:	89 45 e0             	mov    %eax,-0x20(%ebp)
  105f17:	8b 45 e8             	mov    -0x18(%ebp),%eax
  105f1a:	89 45 dc             	mov    %eax,-0x24(%ebp)
        "andl $3, %%ecx;"
        "jz 1f;"
        "rep; movsb;"
        "1:"
        : "=&c" (d0), "=&D" (d1), "=&S" (d2)
        : "0" (n / 4), "g" (n), "1" (dst), "2" (src)
  105f1d:	8b 45 dc             	mov    -0x24(%ebp),%eax
  105f20:	c1 e8 02             	shr    $0x2,%eax
  105f23:	89 c1                	mov    %eax,%ecx
#ifndef __HAVE_ARCH_MEMCPY
#define __HAVE_ARCH_MEMCPY
static inline void *
__memcpy(void *dst, const void *src, size_t n) {
    int d0, d1, d2;
    asm volatile (
  105f25:	8b 55 e4             	mov    -0x1c(%ebp),%edx
  105f28:	8b 45 e0             	mov    -0x20(%ebp),%eax
  105f2b:	89 d7                	mov    %edx,%edi
  105f2d:	89 c6                	mov    %eax,%esi
  105f2f:	f3 a5                	rep movsl %ds:(%esi),%es:(%edi)
  105f31:	8b 4d dc             	mov    -0x24(%ebp),%ecx
  105f34:	83 e1 03             	and    $0x3,%ecx
  105f37:	74 02                	je     105f3b <memmove+0x53>
  105f39:	f3 a4                	rep movsb %ds:(%esi),%es:(%edi)
  105f3b:	89 f0                	mov    %esi,%eax
  105f3d:	89 fa                	mov    %edi,%edx
  105f3f:	89 4d d8             	mov    %ecx,-0x28(%ebp)
  105f42:	89 55 d4             	mov    %edx,-0x2c(%ebp)
  105f45:	89 45 d0             	mov    %eax,-0x30(%ebp)
        "rep; movsb;"
        "1:"
        : "=&c" (d0), "=&D" (d1), "=&S" (d2)
        : "0" (n / 4), "g" (n), "1" (dst), "2" (src)
        : "memory");
    return dst;
  105f48:	8b 45 e4             	mov    -0x1c(%ebp),%eax
  105f4b:	eb 36                	jmp    105f83 <memmove+0x9b>
    asm volatile (
        "std;"
        "rep; movsb;"
        "cld;"
        : "=&c" (d0), "=&S" (d1), "=&D" (d2)
        : "0" (n), "1" (n - 1 + src), "2" (n - 1 + dst)
  105f4d:	8b 45 e8             	mov    -0x18(%ebp),%eax
  105f50:	8d 50 ff             	lea    -0x1(%eax),%edx
  105f53:	8b 45 ec             	mov    -0x14(%ebp),%eax
  105f56:	01 c2                	add    %eax,%edx
  105f58:	8b 45 e8             	mov    -0x18(%ebp),%eax
  105f5b:	8d 48 ff             	lea    -0x1(%eax),%ecx
  105f5e:	8b 45 f0             	mov    -0x10(%ebp),%eax
  105f61:	8d 1c 01             	lea    (%ecx,%eax,1),%ebx
__memmove(void *dst, const void *src, size_t n) {
    if (dst < src) {
        return __memcpy(dst, src, n);
    }
    int d0, d1, d2;
    asm volatile (
  105f64:	8b 45 e8             	mov    -0x18(%ebp),%eax
  105f67:	89 c1                	mov    %eax,%ecx
  105f69:	89 d8                	mov    %ebx,%eax
  105f6b:	89 d6                	mov    %edx,%esi
  105f6d:	89 c7                	mov    %eax,%edi
  105f6f:	fd                   	std    
  105f70:	f3 a4                	rep movsb %ds:(%esi),%es:(%edi)
  105f72:	fc                   	cld    
  105f73:	89 f8                	mov    %edi,%eax
  105f75:	89 f2                	mov    %esi,%edx
  105f77:	89 4d cc             	mov    %ecx,-0x34(%ebp)
  105f7a:	89 55 c8             	mov    %edx,-0x38(%ebp)
  105f7d:	89 45 c4             	mov    %eax,-0x3c(%ebp)
        "rep; movsb;"
        "cld;"
        : "=&c" (d0), "=&S" (d1), "=&D" (d2)
        : "0" (n), "1" (n - 1 + src), "2" (n - 1 + dst)
        : "memory");
    return dst;
  105f80:	8b 45 f0             	mov    -0x10(%ebp),%eax
            *d ++ = *s ++;
        }
    }
    return dst;
#endif /* __HAVE_ARCH_MEMMOVE */
}
  105f83:	83 c4 30             	add    $0x30,%esp
  105f86:	5b                   	pop    %ebx
  105f87:	5e                   	pop    %esi
  105f88:	5f                   	pop    %edi
  105f89:	5d                   	pop    %ebp
  105f8a:	c3                   	ret    

00105f8b <memcpy>:
 * it always copies exactly @n bytes. To avoid overflows, the size of arrays pointed
 * by both @src and @dst, should be at least @n bytes, and should not overlap
 * (for overlapping memory area, memmove is a safer approach).
 * */
void *
memcpy(void *dst, const void *src, size_t n) {
  105f8b:	55                   	push   %ebp
  105f8c:	89 e5                	mov    %esp,%ebp
  105f8e:	57                   	push   %edi
  105f8f:	56                   	push   %esi
  105f90:	83 ec 20             	sub    $0x20,%esp
  105f93:	8b 45 08             	mov    0x8(%ebp),%eax
  105f96:	89 45 f4             	mov    %eax,-0xc(%ebp)
  105f99:	8b 45 0c             	mov    0xc(%ebp),%eax
  105f9c:	89 45 f0             	mov    %eax,-0x10(%ebp)
  105f9f:	8b 45 10             	mov    0x10(%ebp),%eax
  105fa2:	89 45 ec             	mov    %eax,-0x14(%ebp)
        "andl $3, %%ecx;"
        "jz 1f;"
        "rep; movsb;"
        "1:"
        : "=&c" (d0), "=&D" (d1), "=&S" (d2)
        : "0" (n / 4), "g" (n), "1" (dst), "2" (src)
  105fa5:	8b 45 ec             	mov    -0x14(%ebp),%eax
  105fa8:	c1 e8 02             	shr    $0x2,%eax
  105fab:	89 c1                	mov    %eax,%ecx
#ifndef __HAVE_ARCH_MEMCPY
#define __HAVE_ARCH_MEMCPY
static inline void *
__memcpy(void *dst, const void *src, size_t n) {
    int d0, d1, d2;
    asm volatile (
  105fad:	8b 55 f4             	mov    -0xc(%ebp),%edx
  105fb0:	8b 45 f0             	mov    -0x10(%ebp),%eax
  105fb3:	89 d7                	mov    %edx,%edi
  105fb5:	89 c6                	mov    %eax,%esi
  105fb7:	f3 a5                	rep movsl %ds:(%esi),%es:(%edi)
  105fb9:	8b 4d ec             	mov    -0x14(%ebp),%ecx
  105fbc:	83 e1 03             	and    $0x3,%ecx
  105fbf:	74 02                	je     105fc3 <memcpy+0x38>
  105fc1:	f3 a4                	rep movsb %ds:(%esi),%es:(%edi)
  105fc3:	89 f0                	mov    %esi,%eax
  105fc5:	89 fa                	mov    %edi,%edx
  105fc7:	89 4d e8             	mov    %ecx,-0x18(%ebp)
  105fca:	89 55 e4             	mov    %edx,-0x1c(%ebp)
  105fcd:	89 45 e0             	mov    %eax,-0x20(%ebp)
        "rep; movsb;"
        "1:"
        : "=&c" (d0), "=&D" (d1), "=&S" (d2)
        : "0" (n / 4), "g" (n), "1" (dst), "2" (src)
        : "memory");
    return dst;
  105fd0:	8b 45 f4             	mov    -0xc(%ebp),%eax
    while (n -- > 0) {
        *d ++ = *s ++;
    }
    return dst;
#endif /* __HAVE_ARCH_MEMCPY */
}
  105fd3:	83 c4 20             	add    $0x20,%esp
  105fd6:	5e                   	pop    %esi
  105fd7:	5f                   	pop    %edi
  105fd8:	5d                   	pop    %ebp
  105fd9:	c3                   	ret    

00105fda <memcmp>:
 *   match in both memory blocks has a greater value in @v1 than in @v2
 *   as if evaluated as unsigned char values;
 * - And a value less than zero indicates the opposite.
 * */
int
memcmp(const void *v1, const void *v2, size_t n) {
  105fda:	55                   	push   %ebp
  105fdb:	89 e5                	mov    %esp,%ebp
  105fdd:	83 ec 10             	sub    $0x10,%esp
    const char *s1 = (const char *)v1;
  105fe0:	8b 45 08             	mov    0x8(%ebp),%eax
  105fe3:	89 45 fc             	mov    %eax,-0x4(%ebp)
    const char *s2 = (const char *)v2;
  105fe6:	8b 45 0c             	mov    0xc(%ebp),%eax
  105fe9:	89 45 f8             	mov    %eax,-0x8(%ebp)
    while (n -- > 0) {
  105fec:	eb 30                	jmp    10601e <memcmp+0x44>
        if (*s1 != *s2) {
  105fee:	8b 45 fc             	mov    -0x4(%ebp),%eax
  105ff1:	0f b6 10             	movzbl (%eax),%edx
  105ff4:	8b 45 f8             	mov    -0x8(%ebp),%eax
  105ff7:	0f b6 00             	movzbl (%eax),%eax
  105ffa:	38 c2                	cmp    %al,%dl
  105ffc:	74 18                	je     106016 <memcmp+0x3c>
            return (int)((unsigned char)*s1 - (unsigned char)*s2);
  105ffe:	8b 45 fc             	mov    -0x4(%ebp),%eax
  106001:	0f b6 00             	movzbl (%eax),%eax
  106004:	0f b6 d0             	movzbl %al,%edx
  106007:	8b 45 f8             	mov    -0x8(%ebp),%eax
  10600a:	0f b6 00             	movzbl (%eax),%eax
  10600d:	0f b6 c0             	movzbl %al,%eax
  106010:	29 c2                	sub    %eax,%edx
  106012:	89 d0                	mov    %edx,%eax
  106014:	eb 1a                	jmp    106030 <memcmp+0x56>
        }
        s1 ++, s2 ++;
  106016:	83 45 fc 01          	addl   $0x1,-0x4(%ebp)
  10601a:	83 45 f8 01          	addl   $0x1,-0x8(%ebp)
 * */
int
memcmp(const void *v1, const void *v2, size_t n) {
    const char *s1 = (const char *)v1;
    const char *s2 = (const char *)v2;
    while (n -- > 0) {
  10601e:	8b 45 10             	mov    0x10(%ebp),%eax
  106021:	8d 50 ff             	lea    -0x1(%eax),%edx
  106024:	89 55 10             	mov    %edx,0x10(%ebp)
  106027:	85 c0                	test   %eax,%eax
  106029:	75 c3                	jne    105fee <memcmp+0x14>
        if (*s1 != *s2) {
            return (int)((unsigned char)*s1 - (unsigned char)*s2);
        }
        s1 ++, s2 ++;
    }
    return 0;
  10602b:	b8 00 00 00 00       	mov    $0x0,%eax
}
  106030:	c9                   	leave  
  106031:	c3                   	ret    
